Skip to content

Commit

Permalink
mlxsw: spectrum_router: Simplify a piece of code
Browse files Browse the repository at this point in the history
Express the same logic more succinctly.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Petr Machata authored and David S. Miller committed Jul 31, 2017
1 parent 56b8a9e commit 213666a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
Original file line number Diff line number Diff line change
Expand Up @@ -1752,9 +1752,9 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
static void __mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp_nexthop *nh,
bool removing)
{
if (!removing && !nh->should_offload)
if (!removing)
nh->should_offload = 1;
else if (removing && nh->offloaded)
else if (nh->offloaded)
nh->should_offload = 0;
nh->update = 1;
}
Expand Down

0 comments on commit 213666a

Please sign in to comment.