Skip to content

Commit

Permalink
drivers/net/cxgb3: fix sparse warning: symbol shadows an earlier one
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hannes Eder authored and David S. Miller committed Feb 18, 2009
1 parent 54b8732 commit 97915b5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/cxgb3/cxgb3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down

0 comments on commit 97915b5

Please sign in to comment.