Skip to content

Commit

Permalink
mlxsw: use netif_is_any_bridge_port() instead of open code
Browse files Browse the repository at this point in the history
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@gmail.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Juhee Kang authored and David S. Miller committed Jul 22, 2022
1 parent b66eb3a commit 59ad247
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 59ad247

Please sign in to comment.