mlxsw: spectrum_router: Clarify a piece of code
authorPetr Machata <petrm@mellanox.com>
Mon, 31 Jul 2017 07:27:29 +0000 (09:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Jul 2017 21:44:33 +0000 (14:44 -0700)
Prefer logical operator that expresses the intent to bitwise one that
happens to give the same result.

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 600268cf4fa111c2b0a712275e1be441fe178f77..c69efbd955c5b1fd09bf47c77d322131c37a78e9 100644 (file)
@@ -1668,7 +1668,7 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
        for (i = 0; i < nh_grp->count; i++) {
                nh = &nh_grp->nexthops[i];
 
-               if (nh->should_offload ^ nh->offloaded) {
+               if (nh->should_offload != nh->offloaded) {
                        offload_change = true;
                        if (nh->should_offload)
                                nh->update = 1;