[coreboot] [flashrom] [patch] Warning in satasii.c with GCC 4.4.0

Urja Rannikko urjaman at gmail.com
Sun May 31 21:55:41 CEST 2009

Hi all,

Fix warning in satasii.c.
This fix is simple as in i think it doesnt change the code logic at
all and doesnt add a level of parentheses (ugly),
but i can't test as i dont have the necessary hardware.

Signed-off-by: Urja Rannikko <urjaman at gmail.com>

I got this warning (as error) compiling flashrom with gcc 4.4.0:
cc -Os -Wall -Werror   -c -o satasii.o satasii.c
cc1: warnings being treated as errors
satasii.c: In function ‘satasii_init’:
satasii.c:67: error: suggest parentheses around operand of ‘!’ or
change ‘&’ to ‘&&’ or ‘!’ to ‘~’

Patch also inlined:
Index: satasii.c
--- satasii.c	(revision 557)
+++ satasii.c	(working copy)
@@ -64,7 +64,7 @@
 	sii_bar = physmap("SATA SIL registers", addr, 0x100) + reg_offset;

 	/* Check if ROM cycle are OK. */
-	if ((id != 0x0680) && (!(mmio_readl(sii_bar)) & (1 << 26)))
+	if ((id != 0x0680) && ((!mmio_readl(sii_bar)) & (1 << 26)))
 		printf("Warning: Flash seems unconnected.\n");

 	return 0;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: satasii_warning.patch
Type: application/octet-stream
Size: 455 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090531/f225f4e0/attachment.obj>

More information about the coreboot mailing list