diff options
author | Zhu Yanjun <yanjun.zhu@oracle.com> | 2017-05-03 00:43:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-04 10:57:41 -0400 |
commit | 5d826b7b98a66c890920d690d101bf54d220ea92 (patch) | |
tree | 729fc328f649ad84637b9f3def9195b81c68c175 /drivers/net/ethernet/nvidia | |
parent | f411af6822182f84834c4881b825dd40534e7fe8 (diff) | |
download | linux-next-5d826b7b98a66c890920d690d101bf54d220ea92.tar.gz |
forcedeth: remove unnecessary carrier status check
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>
Diffstat (limited to 'drivers/net/ethernet/nvidia')
-rw-r--r-- | drivers/net/ethernet/nvidia/forcedeth.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 978d32944c80..aa912f43e15f 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -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); } } |