mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 21:02:19 +00:00
mlxsw: spectrum_trap: Use 'size_t' for array sizes
Use 'size_t' instead of 'u64' for array sizes, as this this is correct type to use for expressions involving sizeof(). Suggested-by: Petr Machata <petrm@mellanox.com> Reviewed-by: Petr Machata <petrm@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c88e11e047
commit
76ba292cc7
@ -1063,10 +1063,10 @@ static int mlxsw_sp_trap_dummy_group_init(struct mlxsw_sp *mlxsw_sp)
|
||||
|
||||
static int mlxsw_sp_trap_policer_items_arr_init(struct mlxsw_sp *mlxsw_sp)
|
||||
{
|
||||
size_t arr_size = ARRAY_SIZE(mlxsw_sp_trap_policer_items_arr);
|
||||
size_t elem_size = sizeof(struct mlxsw_sp_trap_policer_item);
|
||||
u64 arr_size = ARRAY_SIZE(mlxsw_sp_trap_policer_items_arr);
|
||||
struct mlxsw_sp_trap *trap = mlxsw_sp->trap;
|
||||
u64 free_policers = 0;
|
||||
size_t free_policers = 0;
|
||||
u32 last_id;
|
||||
int i;
|
||||
|
||||
|
@ -9,13 +9,13 @@
|
||||
|
||||
struct mlxsw_sp_trap {
|
||||
struct mlxsw_sp_trap_policer_item *policer_items_arr;
|
||||
u64 policers_count; /* Number of registered policers */
|
||||
size_t policers_count; /* Number of registered policers */
|
||||
|
||||
struct mlxsw_sp_trap_group_item *group_items_arr;
|
||||
u64 groups_count; /* Number of registered groups */
|
||||
size_t groups_count; /* Number of registered groups */
|
||||
|
||||
struct mlxsw_sp_trap_item *trap_items_arr;
|
||||
u64 traps_count; /* Number of registered traps */
|
||||
size_t traps_count; /* Number of registered traps */
|
||||
|
||||
u16 thin_policer_hw_id;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user