Skip to contentSkip to conversation

image-fit: Fix compiler warning in fit_conf_print()

PATCH In review Hans de Goede 2 participants 3 messages May 29, 2015 – Jun 6, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image-fit: Fix compiler warning in fit_conf_print()

This fixes the following compiler warning:

In file included from tools/common/image-fit.c:1:0:
./tools/../common/image-fit.c: In function ?fit_conf_print?:
./tools/../common/image-fit.c:1470:27: warning: logical not is only applied
to the left hand side of comparison [-Wlogical-not-parentheses]

    (const char **)&uname) > 0;
---
 common/image-fit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/image-fit.c +2 -2
index 4bd8fea..28f7aa8 100644
@@ -1464,10 +1464,10 @@ void fit_conf_print(const void *fit, int noffset, const char *p)
 
 	/* Print out all of the specified loadables */
 	for (loadables_index = 0;
-	     !fdt_get_string_index(fit, noffset,
+	     fdt_get_string_index(fit, noffset,
 			FIT_LOADABLE_PROP,
 			loadables_index,
-			(const char **)&uname) > 0;
+			(const char **)&uname) == 0;
 	     loadables_index++)
 	{
 		if (loadables_index == 0) {
Signature · 1 line
2.4.1
#1 lore raw

Hi All,

Quoted 7 lines · Hans de Goede

This fixes the following compiler warning:

In file included from tools/common/image-fit.c:1:0:
./tools/../common/image-fit.c: In function ?fit_conf_print?:
./tools/../common/image-fit.c:1470:27: warning: logical not is only applied
to the left hand side of comparison [-Wlogical-not-parentheses]

     (const char **)&uname) > 0;

ping? it would be nice to get this fixed, as it is the only compiler warning I see when building u-boot.

Tom, can you pick this one up directly perhaps?

Regards,

Hans

Quoted 24 lines
---
  common/image-fit.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
common/image-fit.c +2 -2
index 4bd8fea..28f7aa8 100644
@@ -1464,10 +1464,10 @@ void fit_conf_print(const void *fit, int noffset, const char *p)
 
  	/* Print out all of the specified loadables */
  	for (loadables_index = 0;
-	     !fdt_get_string_index(fit, noffset,
+	     fdt_get_string_index(fit, noffset,
  			FIT_LOADABLE_PROP,
  			loadables_index,
-			(const char **)&uname) > 0;
+			(const char **)&uname) == 0;
  	     loadables_index++)
  	{
  		if (loadables_index == 0) {
#2 lore raw
In reply to Hans de Goede
Quoted 9 lines · Hans de Goede

This fixes the following compiler warning:

In file included from tools/common/image-fit.c:1:0:
./tools/../common/image-fit.c: In function ?fit_conf_print?:
./tools/../common/image-fit.c:1470:27: warning: logical not is only applied
to the left hand side of comparison [-Wlogical-not-parentheses]

    (const char **)&uname) > 0;

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150606/4cd94f18/attachment.sig>