Skip to content

Commit

Permalink
mlxsw: spectrum: remove redundant check if err is zero
Browse files Browse the repository at this point in the history
There is an earlier check and return if err is non-zero, so
the check to see if it is zero is redundant in every iteration
of the loop and hence the check can be removed.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Colin Ian King authored and David S. Miller committed Sep 24, 2016
1 parent 7f8c286 commit faac0ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlxsw/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ static void __mlxsw_sp_port_get_stats(struct net_device *dev,
return;
mlxsw_sp_port_get_stats_raw(dev, grp, prio, ppcnt_pl);
for (i = 0; i < len; i++)
data[data_index + i] = !err ? hw_stats[i].getter(ppcnt_pl) : 0;
data[data_index + i] = hw_stats[i].getter(ppcnt_pl);
}

static void mlxsw_sp_port_get_stats(struct net_device *dev,
Expand Down

0 comments on commit faac0ff

Please sign in to comment.