Re: [PATCH 02/27] drivers/net: fix sparse warnings: make do-while a compound statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hannes Eder <hannes@xxxxxxxxxxxxxx> writes:

> Fix this sparse warnings:

Or: break the formating to silence sparse.

>   drivers/net/atp.c:811:8: warning: do-while statement is not a compound statement
>   drivers/net/atp.c:813:8: warning: do-while statement is not a compound statement
>   drivers/net/atp.c:815:11: warning: do-while statement is not a compound statement
>   drivers/net/atp.c:817:11: warning: do-while statement is not a compound statement

> --- a/drivers/net/starfire.c
> +++ b/drivers/net/starfire.c
> @@ -882,9 +882,9 @@ static int mdio_read(struct net_device *dev, int phy_id, int location)
>  	void __iomem *mdio_addr = np->base + MIICtrl + (phy_id<<7) + (location<<2);
>  	int result, boguscnt=1000;
>  	/* ??? Should we add a busy-wait here? */
> -	do
> +	do {
>  		result = readl(mdio_addr);
> -	while ((result & 0xC0000000) != 0x80000000 && --boguscnt > 0);
> +	} while ((result & 0xC0000000) != 0x80000000 && --boguscnt > 0);
>  	if (boguscnt == 0)
>  		return 0;
>  	if ((result & 0xffff) == 0xffff)


I don't know how one could think the above is an improvement.

This "do-while statement is not a compound statement" warning is
pure nonsense.
-- 
Krzysztof Halasa
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux