lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201224132313.31070-1-zhengyongjun3@huawei.com>
Date:   Thu, 24 Dec 2020 21:23:13 +0800
From:   Zheng Yongjun <zhengyongjun3@...wei.com>
To:     <alexander.shishkin@...ux.intel.com>, <mcoquelin.stm32@...il.com>,
        <alexandre.torgue@...com>, <linux-kernel@...r.kernel.org>
CC:     Zheng Yongjun <zhengyongjun3@...wei.com>
Subject: [PATCH v2 -next] hwtracing: stm: use DEFINE_MUTEX() for mutex lock

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

Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ