lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1257271294.8625.9.camel@HP1>
Date:	Tue, 3 Nov 2009 10:01:34 -0800
From:	"Michael Chan" <mchan@...adcom.com>
To:	"Eric Dumazet" <eric.dumazet@...il.com>
cc:	"David S. Miller" <davem@...emloft.net>,
	"Linux Netdev List" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next-2.6] bnx2: avoid compiler warnings


On Tue, 2009-11-03 at 01:17 -0800, Eric Dumazet wrote:
> drivers/net/bnx2.c: In function ‘bnx2_enable_forced_2g5’:
> drivers/net/bnx2.c:1447: warning: ‘bmcr’ may be used uninitialized in this function
> drivers/net/bnx2.c: In function ‘bnx2_disable_forced_2g5’:
> drivers/net/bnx2.c:1482: warning: ‘bmcr’ may be used uninitialized in this function
> 
> One fix would be to have an initial value, but a plain return might be better.

I agree that plain return is better.  Thanks.

Acked-by: Michael Chan <mchan@...adcom.com>

> 
> Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
> ---
> 
> diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
> index 08cddb6..539d23b 100644
> --- a/drivers/net/bnx2.c
> +++ b/drivers/net/bnx2.c
> @@ -1466,6 +1466,8 @@ bnx2_enable_forced_2g5(struct bnx2 *bp)
>  	} else if (CHIP_NUM(bp) == CHIP_NUM_5708) {
>  		bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
>  		bmcr |= BCM5708S_BMCR_FORCE_2500;
> +	} else {
> +		return;
>  	}
>  
>  	if (bp->autoneg & AUTONEG_SPEED) {
> @@ -1500,6 +1502,8 @@ bnx2_disable_forced_2g5(struct bnx2 *bp)
>  	} else if (CHIP_NUM(bp) == CHIP_NUM_5708) {
>  		bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
>  		bmcr &= ~BCM5708S_BMCR_FORCE_2500;
> +	} else {
> +		return;
>  	}
>  
>  	if (bp->autoneg & AUTONEG_SPEED)
> 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ