]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
forcedeth: remove unnecessary carrier status check
authorZhu Yanjun <yanjun.zhu@oracle.com>
Wed, 3 May 2017 04:43:42 +0000 (00:43 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 May 2017 14:57:41 +0000 (10:57 -0400)
Since netif_carrier_on() will do nothing if device's
carrier is already on, so it's unnecessary to do
carrier status check.

It's the same for netif_carrier_off().

Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/nvidia/forcedeth.c

index 978d32944c8047bf4c4ab3d849d2acc39b8dfb5a..aa912f43e15f88140f1e84e816ab1fe3e7662642 100644 (file)
@@ -4248,11 +4248,9 @@ static int nv_get_link_ksettings(struct net_device *dev,
                /* We do not track link speed / duplex setting if the
                 * interface is disabled. Force a link check */
                if (nv_update_linkspeed(dev)) {
-                       if (!netif_carrier_ok(dev))
-                               netif_carrier_on(dev);
+                       netif_carrier_on(dev);
                } else {
-                       if (netif_carrier_ok(dev))
-                               netif_carrier_off(dev);
+                       netif_carrier_off(dev);
                }
        }