Commit abbc7928 authored by Juhee Kang's avatar Juhee Kang Committed by Jakub Kicinski

net: rtnetlink: use netif_oper_up instead of open code

The open code is defined as a new helper function(netif_oper_up) on netdev.h,
the code is dev->operstate == IF_OPER_UP || dev->operstate == IF_OPER_UNKNOWN.
Thus, replace the open code to netif_oper_up. This patch doesn't change logic.
Signed-off-by: default avatarJuhee Kang <claudiajkang@gmail.com>
Link: https://lore.kernel.org/r/20220831125845.1333-1-claudiajkang@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 75aad41a
......@@ -866,14 +866,12 @@ static void set_operstate(struct net_device *dev, unsigned char transition)
break;
case IF_OPER_TESTING:
if (operstate == IF_OPER_UP ||
operstate == IF_OPER_UNKNOWN)
if (netif_oper_up(dev))
operstate = IF_OPER_TESTING;
break;
case IF_OPER_DORMANT:
if (operstate == IF_OPER_UP ||
operstate == IF_OPER_UNKNOWN)
if (netif_oper_up(dev))
operstate = IF_OPER_DORMANT;
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment