diff options
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c')
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c index ee59c79156e4..b1094aaffa5f 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.c @@ -24,7 +24,7 @@ struct mlxsw_sp_counter_pool { spinlock_t counter_pool_lock; /* Protects counter pool allocations */ atomic_t active_entries_count; unsigned int sub_pools_count; - struct mlxsw_sp_counter_sub_pool sub_pools[]; + struct mlxsw_sp_counter_sub_pool sub_pools[] __counted_by(sub_pools_count); }; static const struct mlxsw_sp_counter_sub_pool mlxsw_sp_counter_sub_pools[] = { @@ -170,8 +170,7 @@ void mlxsw_sp_counter_pool_fini(struct mlxsw_sp *mlxsw_sp) struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); mlxsw_sp_counter_sub_pools_fini(mlxsw_sp); - WARN_ON(find_first_bit(pool->usage, pool->pool_size) != - pool->pool_size); + WARN_ON(!bitmap_empty(pool->usage, pool->pool_size)); WARN_ON(atomic_read(&pool->active_entries_count)); bitmap_free(pool->usage); devl_resource_occ_get_unregister(devlink, |
