Skip to contentSkip to conversation

spl: fit: Fixed incompatible type warning in spl_load_fit_image()

PATCH New Jean-Jacques Hiblot 3 participants 4 messages Sep 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: fit: Fixed incompatible type warning in spl_load_fit_image()

Warning introduced in commit 7264f29 (spl: fit: Eanble GZIP support for image decompression)

---
 common/spl/spl_fit.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
common/spl/spl_fit.c +3 -1
index 49ccf1c..22d3161 100644
@@ -197,11 +197,13 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
 	    IS_ENABLED(CONFIG_SPL_GZIP)		&&
 	    image_comp == IH_COMP_GZIP		&&
 	    type == IH_TYPE_KERNEL) {
+		long unsigned int sz = length;
 		if (gunzip((void *)load_addr, CONFIG_SYS_BOOTM_LEN,
-			   src, &length)) {
+			   src, &sz)) {
 			puts("Uncompressing error\n");
 			return -EIO;
 		}
+		length = sz;
 	} else {
 		memcpy((void *)load_addr, src, length);
 	}
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 spl: fit: Fixed incompatible type warning in spl_load_fit_image()

Quoted 17 lines · Jean-Jacques Hiblot

Warning introduced in commit 7264f29 (spl: fit: Eanble GZIP support for image decompression)

---
 common/spl/spl_fit.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
common/spl/spl_fit.c +1 -0
index 49ccf1c..22d3161 100644
@@ -197,11 +197,13 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
 	    IS_ENABLED(CONFIG_SPL_GZIP)		&&
 	    image_comp == IH_COMP_GZIP		&&
 	    type == IH_TYPE_KERNEL) {
+		long unsigned int sz = length;

common/spl/spl_fit.c static int spl_load_fit_image(struct spl_load_info *info, ulong sector, · line 209

Quoted 10 lines
common/spl/spl_fit.c +2 -1
 		if (gunzip((void *)load_addr, CONFIG_SYS_BOOTM_LEN,
-			   src, &length)) {
+			   src, &sz)) {
 			puts("Uncompressing error\n");
 			return -EIO;
 		}
+		length = sz;
 	} else {
 		memcpy((void *)load_addr, src, length);
 	}

York posted a fix for this yesterday at
https://patchwork.ozlabs.org/patch/813927/ and since he introduced the warning I'm going to grab that one, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170915/4905ec2b/attachment.sig>
#2 lore raw

PATCH 1/1 spl: fit: Fixed incompatible type warning in spl_load_fit_image()

Hi Tom, York

Quoted 24 lines · Tom Rini
Quoted 22 lines · Jean-Jacques Hiblot

Warning introduced in commit 7264f29 (spl: fit: Eanble GZIP support for image decompression)

---
  common/spl/spl_fit.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
common/spl/spl_fit.c +2 -1
index 49ccf1c..22d3161 100644
@@ -197,11 +197,13 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
  	    IS_ENABLED(CONFIG_SPL_GZIP)		&&
  	    image_comp == IH_COMP_GZIP		&&
  	    type == IH_TYPE_KERNEL) {
+		long unsigned int sz = length;
  		if (gunzip((void *)load_addr, CONFIG_SYS_BOOTM_LEN,
-			   src, &length)) {
+			   src, &sz)) {
  			puts("Uncompressing error\n");
  			return -EIO;
Quoted 8 lines

common/spl/spl_fit.c static int spl_load_fit_image(struct spl_load_info *info, ulong sector, · line 209

Quoted 5 lines
common/spl/spl_fit.c +1 -0
  		}
+		length = sz;
  	} else {
  		memcpy((void *)load_addr, src, length);
  	}

York posted a fix for this yesterday at
https://patchwork.ozlabs.org/patch/813927/ and since he introduced the warning I'm going to grab that one, thanks!

Sorry, I didn't check the mailing first.
There is a potential issue with York's patch. I'll comment about it in the other thread.
JJ

Quoted 1 line
#3 lore raw

PATCH 1/1 spl: fit: Fixed incompatible type warning in spl_load_fit_image()

Quoted 36 lines · Jean-Jacques Hiblot

Hi Tom, York

Quoted 24 lines · Tom Rini
Quoted 22 lines · Jean-Jacques Hiblot

Warning introduced in commit 7264f29 (spl: fit: Eanble GZIP support for image decompression)

---
   common/spl/spl_fit.c | 4 +++-
   1 file changed, 3 insertions(+), 1 deletion(-)
common/spl/spl_fit.c +2 -1
index 49ccf1c..22d3161 100644
@@ -197,11 +197,13 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
   	    IS_ENABLED(CONFIG_SPL_GZIP)		&&
   	    image_comp == IH_COMP_GZIP		&&
   	    type == IH_TYPE_KERNEL) {
+		long unsigned int sz = length;
   		if (gunzip((void *)load_addr, CONFIG_SYS_BOOTM_LEN,
-			   src, &length)) {
+			   src, &sz)) {
   			puts("Uncompressing error\n");
   			return -EIO;
Quoted 8 lines

common/spl/spl_fit.c static int spl_load_fit_image(struct spl_load_info *info, ulong sector, · line 209

Quoted 5 lines
common/spl/spl_fit.c +1 -0
   		}
+		length = sz;
   	} else {
   		memcpy((void *)load_addr, src, length);
   	}

York posted a fix for this yesterday at
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F813927%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cc54125726efc412406b608d4fc495cd3%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=N11zEx1iLXn%2FpyXLiAqqQudsrh5SnOZxw1kAJISaOw4%3D&reserved=0 and since he introduced the warning I'm going to grab that one, thanks!

Quoted 3 lines

Sorry, I didn't check the mailing first.
There is a potential issue with York's patch. I'll comment about it in the other thread.

I see what you mean. I should update the length after gunzip.

York