mlxsw: Use refcount_t for reference counting
authorAmit Cohen <amcohen@nvidia.com>
Fri, 26 Jan 2024 18:58:31 +0000 (19:58 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 30 Jan 2024 14:47:36 +0000 (15:47 +0100)
commit1267f7223bec186dc26ef4e6075496c6217355de
treedb93be129f9338ae168c73a6593cee01952c7845
parentbe2f16a994f09b7f95db57f106520dd5e2585050
mlxsw: Use refcount_t for reference counting

mlxsw driver uses 'unsigned int' for reference counters in several
structures. Instead, use refcount_t type which allows us to catch overflow
and underflow issues. Change the type of the counters and use the
appropriate API.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c