]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mlxsw: spectrum_router: Simplify a piece of code
authorPetr Machata <petrm@mellanox.com>
Mon, 31 Jul 2017 07:27:30 +0000 (09:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Jul 2017 21:44:33 +0000 (14:44 -0700)
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>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

index c69efbd955c5b1fd09bf47c77d322131c37a78e9..802f5b8d87619c13ed31d68a94b75f8bdabbe29b 100644 (file)
@@ -1752,9 +1752,9 @@ set_trap:
 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;
 }