mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-22 00:40:03 +00:00
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>
This commit is contained in:
parent
8ecbc40ada
commit
0575c86b5d
1 changed files with 4 additions and 7 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue