All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 -next] hwtracing: stm: use DEFINE_MUTEX() for mutex lock
@ 2020-12-24 13:23 Zheng Yongjun
  0 siblings, 0 replies; only message in thread
From: Zheng Yongjun @ 2020-12-24 13:23 UTC (permalink / raw)
  To: alexander.shishkin, mcoquelin.stm32, alexandre.torgue, linux-kernel
  Cc: Zheng Yongjun

mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/hwtracing/stm/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index 2712e699ba08..84c4af6c6dd6 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -367,7 +367,7 @@ static int major_match(struct device *dev, const void *data)
  * with the STM class framework.
  */
 static struct list_head stm_pdrv_head;
-static struct mutex stm_pdrv_mutex;
+static DEFINE_MUTEX(stm_pdrv_mutex);
 
 struct stm_pdrv_entry {
 	struct list_head			entry;
@@ -1326,7 +1326,6 @@ static int __init stm_core_init(void)
 
 	init_srcu_struct(&stm_source_srcu);
 	INIT_LIST_HEAD(&stm_pdrv_head);
-	mutex_init(&stm_pdrv_mutex);
 
 	/*
 	 * So as to not confuse existing users with a requirement
-- 
2.22.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-24 13:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 13:23 [PATCH v2 -next] hwtracing: stm: use DEFINE_MUTEX() for mutex lock Zheng Yongjun

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.