diff options
author | Ye Bin <yebin10@huawei.com> | 2021-04-09 17:51:47 +0800 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-04-12 15:37:38 -0300 |
commit | 8166e0090511275f0da13a09824bdb43c7972405 (patch) | |
tree | 1da78815336ebbd3183b378db8026f1970f52a96 | |
parent | 22efb0a8d130c6379c1eb64cbace1542b27e37ff (diff) | |
download | linux-8166e0090511275f0da13a09824bdb43c7972405.tar.bz2 |
RDMA/i40iw: Use DEFINE_SPINLOCK() for spinlock
spinlock can be initialized automatically with DEFINE_SPINLOCK() rather
than explicitly calling spin_lock_init().
Link: https://lore.kernel.org/r/20210409095147.2294269-1-yebin10@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
-rw-r--r-- | drivers/infiniband/hw/i40iw/i40iw_main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c index 2ebcbb1ddaa2..b496f30ce066 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_main.c +++ b/drivers/infiniband/hw/i40iw/i40iw_main.c @@ -78,7 +78,7 @@ static struct i40e_client i40iw_client; static char i40iw_client_name[I40E_CLIENT_STR_LENGTH] = "i40iw"; static LIST_HEAD(i40iw_handlers); -static spinlock_t i40iw_handler_lock; +static DEFINE_SPINLOCK(i40iw_handler_lock); static enum i40iw_status_code i40iw_virtchnl_send(struct i40iw_sc_dev *dev, u32 vf_id, u8 *msg, u16 len); @@ -2043,7 +2043,6 @@ static int __init i40iw_init_module(void) i40iw_client.ops = &i40e_ops; memcpy(i40iw_client.name, i40iw_client_name, I40E_CLIENT_STR_LENGTH); i40iw_client.type = I40E_CLIENT_IWARP; - spin_lock_init(&i40iw_handler_lock); ret = i40e_register_client(&i40iw_client); i40iw_register_notifiers(); |