From mboxrd@z Thu Jan 1 00:00:00 1970 From: Huang Guobin Date: Tue, 6 Apr 2021 19:54:07 +0800 Subject: [Cluster-devel] [PATCH -next] dlm: use DEFINE_SPINLOCK() for spinlock Message-ID: <1617710047-47972-1-git-send-email-huangguobin4@huawei.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: Guobin Huang spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Reported-by: Hulk Robot Signed-off-by: Guobin Huang --- 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);