Skip to content

Commit

Permalink
mlxsw: spectrum_router: Remove deadcode in mlxsw_sp_rif_mac_profile_find
Browse files Browse the repository at this point in the history
The function idr_for_each_entry() already checks that the next entry in
the IDR is not NULL.

Therefore, checking that again in every iteration leads to deadcode.

Remove the unnecessary check in order to avoid that.

Addresses-Coverity: ("Logically dead code")
Signed-off-by: Danielle Ratson <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
daniellerts authored and davem330 committed Nov 23, 2021
1 parent 3b0e041 commit ed1607e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
Original file line number Diff line number Diff line change
Expand Up @@ -8369,9 +8369,6 @@ mlxsw_sp_rif_mac_profile_find(const struct mlxsw_sp *mlxsw_sp, const char *mac)
int id;

idr_for_each_entry(&router->rif_mac_profiles_idr, profile, id) {
if (!profile)
continue;

if (ether_addr_equal_masked(profile->mac_prefix, mac,
mlxsw_sp->mac_mask))
return profile;
Expand Down

0 comments on commit ed1607e

Please sign in to comment.