From: Zheng Yongjun <zhengyongjun3@huawei.com>
To: <zhengyongjun3@huawei.com>, Coly Li <colyli@suse.de>,
Kent Overstreet <kent.overstreet@gmail.com>
Cc: <linux-bcache@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
"Hulk Robot" <hulkci@huawei.com>
Subject: [PATCH -next] bcache: use DEFINE_MUTEX() for mutex lock
Date: Mon, 5 Apr 2021 18:14:53 +0800 [thread overview]
Message-ID: <20210405101453.15096-1-zhengyongjun3@huawei.com> (raw)
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
drivers/md/bcache/super.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 78c08a8aece8..c124da6e646d 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -41,7 +41,7 @@ static const char invalid_uuid[] = {
};
static struct kobject *bcache_kobj;
-struct mutex bch_register_lock;
+DEFINE_MUTEX(bch_register_lock);
bool bcache_is_reboot;
LIST_HEAD(bch_cache_sets);
static LIST_HEAD(uncached_devices);
@@ -2870,7 +2870,6 @@ static int __init bcache_init(void)
check_module_parameters();
- mutex_init(&bch_register_lock);
init_waitqueue_head(&unregister_wait);
register_reboot_notifier(&reboot);
next reply other threads:[~2021-04-05 10:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-05 10:14 Zheng Yongjun [this message]
2021-04-05 14:02 ` [PATCH -next] bcache: use DEFINE_MUTEX() for mutex lock Coly Li
2021-04-05 21:17 ` Muhammad Usama Anjum
2021-04-28 16:19 ` Muhammad Usama Anjum
2021-04-29 5:56 ` Dan Carpenter
2021-04-29 10:05 ` Coly Li
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=20210405101453.15096-1-zhengyongjun3@huawei.com \
--to=zhengyongjun3@huawei.com \
--cc=colyli@suse.de \
--cc=hulkci@huawei.com \
--cc=kent.overstreet@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-bcache@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.