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

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Sun May 31 22:19:55 CEST 2009


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

-- 
http://www.hailfinger.org/





More information about the coreboot mailing list