mlx5: Use refcount_t for refcount
Subsystems (5)
PATCH v2 1/3 mlx5: Use refcount_t for refcount
refcount_t is better for reference counters since its implementation can prevent overflows.
So convert atomic_t ref counters to refcount_t.
Signed-off-by Chuhong Yuan <[email protected]>
---
Changes in v2:
- Add #include.
include/linux/mlx5/driver.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/mlx5/driver.h +2 -1
@@ -47,6 +47,7 @@#include <linux/interrupt.h> #include <linux/idr.h> #include <linux/notifier.h> +#include <linux/refcount.h> #include <linux/mlx5/device.h> #include <linux/mlx5/doorbell.h>
@@ -398,7 +399,7 @@ enum mlx5_res_type {struct mlx5_core_rsc_common {enum mlx5_res_type res; -atomic_t refcount; +refcount_t refcount;struct completion free; };
Signature · 1 line
2.20.1