summaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2011-09-01 03:29:38 +0000
committerDavid S. Miller <davem@davemloft.net>2011-09-15 15:36:34 -0400
commitfa3df928e0878350ab0ddd1453bb85b056c726da (patch)
treeb2dc6f573420f56300fa65bcd6fba85af617f3b4 /net/bridge
parente8aaebc6b2a9c36dd9705adcb8f10d14b3d33f75 (diff)
downloadlinux-stable-fa3df928e0878350ab0ddd1453bb85b056c726da.tar.gz
linux-stable-fa3df928e0878350ab0ddd1453bb85b056c726da.tar.bz2
linux-stable-fa3df928e0878350ab0ddd1453bb85b056c726da.zip
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')
-rw-r--r--net/bridge/br_if.c26
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 @@
*/
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;
}
}