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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 6 Apr 2021 19:54:07 +0800
From:   Huang Guobin <huangguobin4@...wei.com>
To:     <huangguobin4@...wei.com>,
        Christine Caulfield <ccaulfie@...hat.com>,
        David Teigland <teigland@...hat.com>
CC:     <cluster-devel@...hat.com>, <linux-kernel@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: [PATCH -next] dlm: use DEFINE_SPINLOCK() for spinlock

From: Guobin Huang <huangguobin4@...wei.com>

spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Guobin Huang <huangguobin4@...wei.com>
---
 fs/dlm/plock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index c38b2b8ffd1d..5a24a2271fdd 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -13,7 +13,7 @@
 #include "dlm_internal.h"
 #include "lockspace.h"
 
-static spinlock_t ops_lock;
+static DEFINE_SPINLOCK(ops_lock);
 static struct list_head send_list;
 static struct list_head recv_list;
 static wait_queue_head_t send_wq;
@@ -492,7 +492,6 @@ int dlm_plock_init(void)
 {
 	int rv;
 
-	spin_lock_init(&ops_lock);
 	INIT_LIST_HEAD(&send_list);
 	INIT_LIST_HEAD(&recv_list);
 	init_waitqueue_head(&send_wq);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ