summaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorZhang Shengju2017-04-26 11:49:38 +0200
committerDavid S. Miller2017-04-27 22:31:05 +0200
commit0575c86b5dd596253bdfc0365b570d67b1a12523 (patch)
treed8b5e683dfca962f0e495b919c283132165b6a1a /net/core/dev.c
parentnet: update comment for netif_dormant() function (diff)
downloadkernel-qcow2-linux-0575c86b5dd596253bdfc0365b570d67b1a12523.tar.gz
kernel-qcow2-linux-0575c86b5dd596253bdfc0365b570d67b1a12523.tar.xz
kernel-qcow2-linux-0575c86b5dd596253bdfc0365b570d67b1a12523.zip
net: 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: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 3361ee87fcc2..8371a01eee87 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7245,13 +7245,10 @@ void netif_stacked_transfer_operstate(const struct net_device *rootdev,
else
netif_dormant_off(dev);
- if (netif_carrier_ok(rootdev)) {
- if (!netif_carrier_ok(dev))
- netif_carrier_on(dev);
- } else {
- if (netif_carrier_ok(dev))
- netif_carrier_off(dev);
- }
+ if (netif_carrier_ok(rootdev))
+ netif_carrier_on(dev);
+ else
+ netif_carrier_off(dev);
}
EXPORT_SYMBOL(netif_stacked_transfer_operstate);