[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220721102648.2455-1-claudiajkang@gmail.com>
Date: Thu, 21 Jul 2022 19:26:47 +0900
From: Juhee Kang <claudiajkang@...il.com>
To: netdev@...r.kernel.org
Cc: tchornyi@...vell.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, idosch@...dia.com,
petrm@...dia.com, linux-kernel@...r.kernel.org,
Juhee Kang <claudiajkang@...il.com>
Subject: [PATCH net-next 1/2] mlxsw: use netif_is_any_bridge_port() instead of open code
The open code which is netif_is_bridge_port() || netif_is_ovs_port() is
defined as a new helper function on netdev.h like netif_is_any_bridge_port
that can check both IFF flags in 1 go. So use netif_is_any_bridge_port()
function instead of open code. This patch doesn't change logic.
Signed-off-by: Juhee Kang <claudiajkang@...il.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 23d526f13f1c..3a16c24154e1 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -8590,9 +8590,7 @@ static int mlxsw_sp_inetaddr_port_event(struct net_device *port_dev,
unsigned long event,
struct netlink_ext_ack *extack)
{
- if (netif_is_bridge_port(port_dev) ||
- netif_is_lag_port(port_dev) ||
- netif_is_ovs_port(port_dev))
+ if (netif_is_any_bridge_port(port_dev) || netif_is_lag_port(port_dev))
return 0;
return mlxsw_sp_inetaddr_port_vlan_event(port_dev, port_dev, event,
--
2.34.1
Powered by blists - more mailing lists