br: remove redundant check and init
authorJiri Pirko <jpirko@redhat.com>
Thu, 1 Sep 2011 03:29:38 +0000 (03:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Sep 2011 19:36:34 +0000 (15:36 -0400)
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>
net/bridge/br_if.c

index 2cdf007..b365bba 100644 (file)
  */
 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;
                }
        }