linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 -next] ecryptfs: use DEFINE_MUTEX() for mutex lock
@ 2020-12-24 13:22 Zheng Yongjun
  2021-01-30 17:57 ` Tyler Hicks
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-24 13:22 UTC (permalink / raw)
  To: ecryptfs, linux-kernel; +Cc: Zheng Yongjun

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

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 fs/ecryptfs/crypto.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 0681540c48d9..be906b9bbb11 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1590,11 +1590,10 @@ ecryptfs_process_key_cipher(struct crypto_skcipher **key_tfm,
 
 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;
 }
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 -next] ecryptfs: use DEFINE_MUTEX() for mutex lock
  2020-12-24 13:22 [PATCH v2 -next] ecryptfs: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
@ 2021-01-30 17:57 ` Tyler Hicks
  0 siblings, 0 replies; 2+ messages in thread
From: Tyler Hicks @ 2021-01-30 17:57 UTC (permalink / raw)
  To: Zheng Yongjun; +Cc: ecryptfs, linux-kernel

On 2020-12-24 21:22:33, Zheng Yongjun wrote:
> mutex lock can be initialized automatically with DEFINE_MUTEX()
> rather than explicitly calling mutex_init().
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>

This looks good to me. I've pushed the patch to the eCryptfs next
branch:

 https://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs.git/log/?h=next

Thanks for the cleanup!

Tyler

> ---
>  fs/ecryptfs/crypto.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
> index 0681540c48d9..be906b9bbb11 100644
> --- a/fs/ecryptfs/crypto.c
> +++ b/fs/ecryptfs/crypto.c
> @@ -1590,11 +1590,10 @@ ecryptfs_process_key_cipher(struct crypto_skcipher **key_tfm,
>  
>  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;
>  }
> -- 
> 2.22.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-30 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 13:22 [PATCH v2 -next] ecryptfs: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
2021-01-30 17:57 ` Tyler Hicks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).