<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GBK">
</head>
<body>
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12.25px; margin-top: 0px; margin-bottom: 1rem; overflow: auto; display: block; color: rgb(79, 93, 115); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().
Reported-by: Hulk Robot <a class="moz-txt-link-rfc2396E" href="mailto:hulkci@huawei.com"><hulkci@huawei.com></a>
Signed-off-by: Baisong Zhong <a class="moz-txt-link-rfc2396E" href="mailto:zhongbaisong@huawei.com"><zhongbaisong@huawei.com></a>
---
fs/dlm/lockspace.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index c14cf2b7faab..5bc19cdad34d 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -28,7 +28,7 @@
static int ls_count;
static struct mutex ls_lock;
static struct list_head lslist;
-static spinlock_t lslist_lock;
+static DEFINE_SPINLOCK(lslist_lock);
static struct task_struct * scand_task;
@@ -233,7 +233,6 @@ int __init dlm_lockspace_init(void)
ls_count = 0;
mutex_init(&ls_lock);
INIT_LIST_HEAD(&lslist);
- spin_lock_init(&lslist_lock);
dlm_kset = kset_create_and_add("dlm", &dlm_uevent_ops, kernel_kobj);
if (!dlm_kset) {</pre>
<br class="Apple-interchange-newline">
<br>
</body>
</html>