Skip to content

Commit

Permalink
br: remove redundant check and init
Browse files Browse the repository at this point in the history
Since these checks and initialization are done in
dev_ethtool_get_settings called later on, remove this redundancy.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Sep 15, 2011
1 parent e8aaebc commit fa3df92
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,18 @@
*/
static int port_cost(struct net_device *dev)
{
if (dev->ethtool_ops && dev->ethtool_ops->get_settings) {
struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET, };

if (!dev_ethtool_get_settings(dev, &ecmd)) {
switch (ethtool_cmd_speed(&ecmd)) {
case SPEED_10000:
return 2;
case SPEED_1000:
return 4;
case SPEED_100:
return 19;
case SPEED_10:
return 100;
}
struct ethtool_cmd ecmd;

if (!dev_ethtool_get_settings(dev, &ecmd)) {
switch (ethtool_cmd_speed(&ecmd)) {
case SPEED_10000:
return 2;
case SPEED_1000:
return 4;
case SPEED_100:
return 19;
case SPEED_10:
return 100;
}
}

Expand Down

0 comments on commit fa3df92

Please sign in to comment.