From: Zheng Yongjun <zhengyongjun3@huawei.com> To: <devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org> Cc: <gregkh@linuxfoundation.org>, Zheng Yongjun <zhengyongjun3@huawei.com> Subject: [PATCH v2 -next] staging: most: net: use DEFINE_MUTEX() for mutex lock Date: Thu, 24 Dec 2020 21:25:19 +0800 [thread overview] Message-ID: <20201224132519.31504-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/staging/most/net/net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c index b6fecb06a0e6..f125bb6da406 100644 --- a/drivers/staging/most/net/net.c +++ b/drivers/staging/most/net/net.c @@ -68,7 +68,7 @@ struct net_dev_context { }; static struct list_head net_devices = LIST_HEAD_INIT(net_devices); -static struct mutex probe_disc_mt; /* ch->linked = true, most_nd_open */ +static DEFINE_MUTEX(probe_disc_mt); /* ch->linked = true, most_nd_open */ static DEFINE_SPINLOCK(list_lock); /* list_head, ch->linked = false, dev_hold */ static struct most_component comp; @@ -520,7 +520,6 @@ static int __init most_net_init(void) { int err; - mutex_init(&probe_disc_mt); err = most_register_component(&comp); if (err) return err; -- 2.22.0
WARNING: multiple messages have this Message-ID (diff)
From: Zheng Yongjun <zhengyongjun3@huawei.com> To: <devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org> Cc: gregkh@linuxfoundation.org, Zheng Yongjun <zhengyongjun3@huawei.com> Subject: [PATCH v2 -next] staging: most: net: use DEFINE_MUTEX() for mutex lock Date: Thu, 24 Dec 2020 21:25:19 +0800 [thread overview] Message-ID: <20201224132519.31504-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/staging/most/net/net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c index b6fecb06a0e6..f125bb6da406 100644 --- a/drivers/staging/most/net/net.c +++ b/drivers/staging/most/net/net.c @@ -68,7 +68,7 @@ struct net_dev_context { }; static struct list_head net_devices = LIST_HEAD_INIT(net_devices); -static struct mutex probe_disc_mt; /* ch->linked = true, most_nd_open */ +static DEFINE_MUTEX(probe_disc_mt); /* ch->linked = true, most_nd_open */ static DEFINE_SPINLOCK(list_lock); /* list_head, ch->linked = false, dev_hold */ static struct most_component comp; @@ -520,7 +520,6 @@ static int __init most_net_init(void) { int err; - mutex_init(&probe_disc_mt); err = most_register_component(&comp); if (err) return err; -- 2.22.0 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next reply other threads:[~2020-12-24 13:26 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-24 13:25 Zheng Yongjun [this message] 2020-12-24 13:25 ` [PATCH v2 -next] staging: most: net: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
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=20201224132519.31504-1-zhengyongjun3@huawei.com \ --to=zhengyongjun3@huawei.com \ --cc=devel@driverdev.osuosl.org \ --cc=gregkh@linuxfoundation.org \ --cc=linux-kernel@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: linkBe 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.