LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: siano: use DEFINE_MUTEX() for mutex lock
@ 2021-04-05 20:52 Muhammad Usama Anjum
  2021-04-28 16:14 ` Muhammad Usama Anjum
  0 siblings, 1 reply; 2+ messages in thread
From: Muhammad Usama Anjum @ 2021-04-05 20:52 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, open list:SIANO DVB DRIVER, open list,
	zhengyongjun3, kernel-janitors, colin.king, dan.carpenter
  Cc: musamaanjum

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

Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
---
 drivers/media/common/siano/smscoreapi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c
index 410cc3ac6f94..7f5b638d2458 100644
--- a/drivers/media/common/siano/smscoreapi.c
+++ b/drivers/media/common/siano/smscoreapi.c
@@ -414,10 +414,10 @@ struct smscore_registry_entry_t {
 
 static struct list_head g_smscore_notifyees;
 static struct list_head g_smscore_devices;
-static struct mutex g_smscore_deviceslock;
+static DEFINE_MUTEX(g_smscore_deviceslock);
 
 static struct list_head g_smscore_registry;
-static struct mutex g_smscore_registrylock;
+static DEFINE_MUTEX(g_smscore_registrylock);
 
 static int default_mode = DEVICE_MODE_NONE;
 
@@ -2123,10 +2123,7 @@ static int __init smscore_module_init(void)
 {
 	INIT_LIST_HEAD(&g_smscore_notifyees);
 	INIT_LIST_HEAD(&g_smscore_devices);
-	mutex_init(&g_smscore_deviceslock);
-
 	INIT_LIST_HEAD(&g_smscore_registry);
-	mutex_init(&g_smscore_registrylock);
 
 	return 0;
 }
-- 
2.25.1


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

* Re: [PATCH] media: siano: use DEFINE_MUTEX() for mutex lock
  2021-04-05 20:52 [PATCH] media: siano: use DEFINE_MUTEX() for mutex lock Muhammad Usama Anjum
@ 2021-04-28 16:14 ` Muhammad Usama Anjum
  0 siblings, 0 replies; 2+ messages in thread
From: Muhammad Usama Anjum @ 2021-04-28 16:14 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, open list:SIANO DVB DRIVER, open list,
	zhengyongjun3, kernel-janitors, colin.king, dan.carpenter
  Cc: musamaanjum

Reminder!

On Tue, 2021-04-06 at 01:52 +0500, Muhammad Usama Anjum wrote:
> mutex lock can be initialized with DEFINE_MUTEX() rather than
> explicitly calling mutex_init().
> 
> Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
> ---
>  drivers/media/common/siano/smscoreapi.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c
> index 410cc3ac6f94..7f5b638d2458 100644
> --- a/drivers/media/common/siano/smscoreapi.c
> +++ b/drivers/media/common/siano/smscoreapi.c
> @@ -414,10 +414,10 @@ struct smscore_registry_entry_t {
>  
>  static struct list_head g_smscore_notifyees;
>  static struct list_head g_smscore_devices;
> -static struct mutex g_smscore_deviceslock;
> +static DEFINE_MUTEX(g_smscore_deviceslock);
>  
>  static struct list_head g_smscore_registry;
> -static struct mutex g_smscore_registrylock;
> +static DEFINE_MUTEX(g_smscore_registrylock);
>  
>  static int default_mode = DEVICE_MODE_NONE;
>  
> @@ -2123,10 +2123,7 @@ static int __init smscore_module_init(void)
>  {
>  	INIT_LIST_HEAD(&g_smscore_notifyees);
>  	INIT_LIST_HEAD(&g_smscore_devices);
> -	mutex_init(&g_smscore_deviceslock);
> -
>  	INIT_LIST_HEAD(&g_smscore_registry);
> -	mutex_init(&g_smscore_registrylock);
>  
>  	return 0;
>  }


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

end of thread, other threads:[~2021-04-28 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 20:52 [PATCH] media: siano: use DEFINE_MUTEX() for mutex lock Muhammad Usama Anjum
2021-04-28 16:14 ` Muhammad Usama Anjum

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 read-only IMAP folder(s) and NNTP newsgroup(s).