diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-08-31 23:29:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-15 15:36:34 -0400 |
commit | fa3df928e0878350ab0ddd1453bb85b056c726da (patch) | |
tree | b2dc6f573420f56300fa65bcd6fba85af617f3b4 /net/bridge/br_if.c | |
parent | e8aaebc6b2a9c36dd9705adcb8f10d14b3d33f75 (diff) |
br: remove redundant check and init
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>
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r-- | net/bridge/br_if.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 2cdf0070419f..b365bba84d19 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -33,20 +33,18 @@ | |||
33 | */ | 33 | */ |
34 | static int port_cost(struct net_device *dev) | 34 | static int port_cost(struct net_device *dev) |
35 | { | 35 | { |
36 | if (dev->ethtool_ops && dev->ethtool_ops->get_settings) { | 36 | struct ethtool_cmd ecmd; |
37 | struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET, }; | 37 | |
38 | 38 | if (!dev_ethtool_get_settings(dev, &ecmd)) { | |
39 | if (!dev_ethtool_get_settings(dev, &ecmd)) { | 39 | switch (ethtool_cmd_speed(&ecmd)) { |
40 | switch (ethtool_cmd_speed(&ecmd)) { | 40 | case SPEED_10000: |
41 | case SPEED_10000: | 41 | return 2; |
42 | return 2; | 42 | case SPEED_1000: |
43 | case SPEED_1000: | 43 | return 4; |
44 | return 4; | 44 | case SPEED_100: |
45 | case SPEED_100: | 45 | return 19; |
46 | return 19; | 46 | case SPEED_10: |
47 | case SPEED_10: | 47 | return 100; |
48 | return 100; | ||
49 | } | ||
50 | } | 48 | } |
51 | } | 49 | } |
52 | 50 | ||