net: rtnetlink: use netif_oper_up instead of open code
Subsystems (2)
PATCH 1/1 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 Juhee Kang <[email protected]>
--- net/core/rtnetlink.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
net/core/rtnetlink.c +2 -4
@@ -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 ; }
Signature · 1 line
2.34.1
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Wed, 31 Aug 2022 21:58:45 +0900 you wrote:
The open code is defined as a new helper
function(netif_oper_up)onnetdev.h, the code isdev->operstate==IF_OPER_UP||dev->operstate==IF_OPER_UNKNOWN. Thus, replace the open code tonetif_oper_up. This patch doesn't change logic.Signed-off-by Juhee Kang <[email protected]>--- net/core/rtnetlink.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Here is the summary with links:
- net: rtnetlink: use netif_oper_up instead of open code
https://git.kernel.org/netdev/net-next/c/abbc79280abc
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html