linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ye Bin <yebin10@huawei.com>
To: <yebin10@huawei.com>, Faisal Latif <faisal.latif@intel.com>,
	Shiraz Saleem <shiraz.saleem@intel.com>,
	Doug Ledford <dledford@redhat.com>,
	"Jason Gunthorpe" <jgg@ziepe.ca>
Cc: <linux-rdma@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	"Hulk Robot" <hulkci@huawei.com>
Subject: [PATCH -next] i40iw: Use DEFINE_SPINLOCK() for spinlock
Date: Fri, 9 Apr 2021 17:51:47 +0800	[thread overview]
Message-ID: <20210409095147.2294269-1-yebin10@huawei.com> (raw)

spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 drivers/infiniband/hw/i40iw/i40iw_main.c | 3 +--
 1 file changed, 1 insertion(+), 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();
 


             reply	other threads:[~2021-04-09  9:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09  9:51 Ye Bin [this message]
2021-04-12 18:39 ` [PATCH -next] i40iw: Use DEFINE_SPINLOCK() for spinlock Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210409095147.2294269-1-yebin10@huawei.com \
    --to=yebin10@huawei.com \
    --cc=dledford@redhat.com \
    --cc=faisal.latif@intel.com \
    --cc=hulkci@huawei.com \
    --cc=jgg@ziepe.ca \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=shiraz.saleem@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).