Hi all,
log: 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@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;
On 31.05.2009 21:55, Urja Rannikko wrote:
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.
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)))
I think the original is ambiguous and the suggested change is incorrect. Hopefully correct code follows:
if ((id != 0x0680) && (!(mmio_readl(sii_bar) & (1 << 26))))
The code tries to test if a given bit is not set.
Regards, Carl-Daniel
I think the original is ambiguous and the suggested change is incorrect. Hopefully correct code follows:
if ((id != 0x0680) && (!(mmio_readl(sii_bar) & (1 << 26))))
The code tries to test if a given bit is not set.
Sorry, I failed to understand that (was wondering of that code...). Now i'm mystified of how the sign-off/ack procedure works when you fixed the only change in my patch ... Who should make the new patch + sign off?
Urja Rannikko wrote:
Now i'm mystified of how the sign-off/ack procedure works when you fixed the only change in my patch ... Who should make the new patch
- sign off?
It doesn't matter. Since Carl-Daniel didn't send a new patch or simply commit with fix, you are more than welcome to send a new patch with your sigoff. In similar situations, sometimes people mention input they have received, other times they don't.
//Peter
Fix warning in satasii.c when compiling with gcc 4.4.0.
Signed-off-by: Urja Rannikko urjaman@gmail.com
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;
On Mon, Jun 01, 2009 at 12:26:31AM +0300, Urja Rannikko wrote:
Fix warning in satasii.c when compiling with gcc 4.4.0.
Signed-off-by: Urja Rannikko urjaman@gmail.com
Yep, thanks! Committed in r558.
Uwe.