Commit 97915b5b authored by Hannes Eder's avatar Hannes Eder Committed by David S. Miller

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: default avatarHannes Eder <hannes@hanneseder.net>
Acked-by: default avatarDivy Le Ray <divy@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 54b87323
...@@ -1565,7 +1565,6 @@ static int speed_duplex_to_caps(int speed, int duplex) ...@@ -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) static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{ {
int cap;
struct port_info *p = netdev_priv(dev); struct port_info *p = netdev_priv(dev);
struct link_config *lc = &p->link_config; struct link_config *lc = &p->link_config;
...@@ -1575,7 +1574,7 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -1575,7 +1574,7 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
* being requested. * being requested.
*/ */
if (cmd->autoneg == AUTONEG_DISABLE) { 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) if (lc->supported & cap)
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment