From: Zheng Yongjun <zhengyongjun3@huawei.com>
To: <linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <leon@kernel.org>, <dledford@redhat.com>, <jgg@ziepe.ca>,
Zheng Yongjun <zhengyongjun3@huawei.com>
Subject: [PATCH v2 -next] mlx5: use DEFINE_MUTEX() for mutex lock
Date: Thu, 24 Dec 2020 21:23:23 +0800 [thread overview]
Message-ID: <20201224132323.31126-1-zhengyongjun3@huawei.com> (raw)
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
drivers/infiniband/hw/mlx5/main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 246e3cbe0b2c..8a260773722f 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -79,7 +79,7 @@ static DEFINE_MUTEX(mlx5_ib_multiport_mutex);
* doesn't work on kernel modules memory
*/
static unsigned long xlt_emergency_page;
-static struct mutex xlt_emergency_page_mutex;
+static DEFINE_MUTEX(xlt_emergency_page_mutex);
struct mlx5_ib_dev *mlx5_ib_get_ibdev_from_mpi(struct mlx5_ib_multiport_info *mpi)
{
@@ -4874,8 +4874,6 @@ static int __init mlx5_ib_init(void)
if (!xlt_emergency_page)
return -ENOMEM;
- mutex_init(&xlt_emergency_page_mutex);
-
mlx5_ib_event_wq = alloc_ordered_workqueue("mlx5_ib_event_wq", 0);
if (!mlx5_ib_event_wq) {
free_page(xlt_emergency_page);
--
2.22.0
next reply other threads:[~2020-12-24 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-24 13:23 Zheng Yongjun [this message]
2020-12-27 5:58 ` [PATCH v2 -next] mlx5: use DEFINE_MUTEX() for mutex lock Leon Romanovsky
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=20201224132323.31126-1-zhengyongjun3@huawei.com \
--to=zhengyongjun3@huawei.com \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/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