drivers/net/cxgb3: fix sparse warning: symbol shadows an earlier one
authorHannes Eder <hannes@hanneseder.net>
Sat, 14 Feb 2009 11:16:04 +0000 (11:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Feb 2009 01:26:09 +0000 (17:26 -0800)
Impact: Move variable declaration as close to usage as possible.

Fix this sparse warning:
  drivers/net/cxgb3/cxgb3_main.c:1586:21: warning: symbol 'cap' shadows an earlier one

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/cxgb3/cxgb3_main.c

index f2c7cc3e263afffade80281415ff1f560bf7d6a2..0f6062aaa2c6ab15aa0accf27f2f94d59abd6915 100644 (file)
@@ -1565,7 +1565,6 @@ static int speed_duplex_to_caps(int speed, int duplex)
 
 static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-       int cap;
        struct port_info *p = netdev_priv(dev);
        struct link_config *lc = &p->link_config;
 
@@ -1575,7 +1574,7 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
                 * being requested.
                 */
                if (cmd->autoneg == AUTONEG_DISABLE) {
-                       cap = speed_duplex_to_caps(cmd->speed, cmd->duplex);
+                       int cap = speed_duplex_to_caps(cmd->speed, cmd->duplex);
                        if (lc->supported & cap)
                                return 0;
                }