Skip to content

Commit b51c876

Browse files
pmachatakuba-moo
authored andcommitted
mlxsw: spectrum_fid: Drop unnecessary conditions
The caller already only calls mlxsw_sp_fid_flood_tables_init() and mlxsw_sp_fid_flood_tables_fini() if (fid_family->flood_tables). There is no configuration where the pointer is non-NULL, but the number of tables is zero. So drop the conditions. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/897c6841bc756ac632b797bf67ac83c6a66ba359.1700503644.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 9aad19a commit b51c876

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,9 +1692,6 @@ mlxsw_sp_fid_flood_tables_init(struct mlxsw_sp_fid_family *fid_family)
16921692
int err;
16931693
int i;
16941694

1695-
if (!fid_family->nr_flood_tables)
1696-
return 0;
1697-
16981695
pgt_size = mlxsw_sp_fid_family_pgt_size(fid_family);
16991696
err = mlxsw_sp_pgt_mid_alloc_range(mlxsw_sp, &fid_family->pgt_base,
17001697
pgt_size);
@@ -1723,9 +1720,6 @@ mlxsw_sp_fid_flood_tables_fini(struct mlxsw_sp_fid_family *fid_family)
17231720
struct mlxsw_sp *mlxsw_sp = fid_family->mlxsw_sp;
17241721
u16 pgt_size;
17251722

1726-
if (!fid_family->nr_flood_tables)
1727-
return;
1728-
17291723
pgt_size = mlxsw_sp_fid_family_pgt_size(fid_family);
17301724
mlxsw_sp_pgt_mid_free_range(mlxsw_sp, fid_family->pgt_base, pgt_size);
17311725
}

0 commit comments

Comments
 (0)