diff options
author | Hannes Eder <hannes@hanneseder.net> | 2009-02-14 06:16:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-17 20:26:09 -0500 |
commit | 97915b5bf6454416c7b27444fc95c08132b74251 (patch) | |
tree | 35aaedbbee99918d241b2474ab02c16f454f7ca8 | |
parent | 54b87323eddd9b7854249f05cfd183a0ac602ab6 (diff) |
drivers/net/cxgb3: fix sparse warning: symbol shadows an earlier one
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>
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index f2c7cc3e263a..0f6062aaa2c6 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -1565,7 +1565,6 @@ static int speed_duplex_to_caps(int speed, int duplex) | |||
1565 | 1565 | ||
1566 | static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 1566 | static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
1567 | { | 1567 | { |
1568 | int cap; | ||
1569 | struct port_info *p = netdev_priv(dev); | 1568 | struct port_info *p = netdev_priv(dev); |
1570 | struct link_config *lc = &p->link_config; | 1569 | struct link_config *lc = &p->link_config; |
1571 | 1570 | ||
@@ -1575,7 +1574,7 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
1575 | * being requested. | 1574 | * being requested. |
1576 | */ | 1575 | */ |
1577 | if (cmd->autoneg == AUTONEG_DISABLE) { | 1576 | if (cmd->autoneg == AUTONEG_DISABLE) { |
1578 | cap = speed_duplex_to_caps(cmd->speed, cmd->duplex); | 1577 | int cap = speed_duplex_to_caps(cmd->speed, cmd->duplex); |
1579 | if (lc->supported & cap) | 1578 | if (lc->supported & cap) |
1580 | return 0; | 1579 | return 0; |
1581 | } | 1580 | } |