ecryptfs: use DEFINE_MUTEX() for mutex lock
authorZheng Yongjun <zhengyongjun3@huawei.com>
Thu, 24 Dec 2020 13:22:33 +0000 (21:22 +0800)
committerTyler Hicks <code@tyhicks.com>
Sat, 30 Jan 2021 17:09:05 +0000 (17:09 +0000)
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Tyler Hicks <code@tyhicks.com>
fs/ecryptfs/crypto.c

index 0681540..be906b9 100644 (file)
@@ -1590,11 +1590,10 @@ out:
 
 struct kmem_cache *ecryptfs_key_tfm_cache;
 static struct list_head key_tfm_list;
-struct mutex key_tfm_list_mutex;
+DEFINE_MUTEX(key_tfm_list_mutex);
 
 int __init ecryptfs_init_crypto(void)
 {
-       mutex_init(&key_tfm_list_mutex);
        INIT_LIST_HEAD(&key_tfm_list);
        return 0;
 }