bnx2: avoid compiler warnings
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 2 Nov 2009 23:17:42 +0000 (23:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Nov 2009 13:06:26 +0000 (05:06 -0800)
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.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2.c

index 08cddb6ff740f4dfac35677e91424378bcf3b2e9..539d23b594ceaa769507c80d99889f3cfe81c510 100644 (file)
@@ -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)