OSDN Git Service

media: siano: use DEFINE_MUTEX() for mutex lock and LIST_HEAD for list head
authorYe Bin <yebin10@huawei.com>
Fri, 9 Apr 2021 09:51:44 +0000 (11:51 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 21 May 2021 13:08:02 +0000 (15:08 +0200)
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().
list head can be initialized automatically with LIST_HEAD()
rather than explicitly calling INIT_LIST_HEAD().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/common/siano/smsdvb-main.c

index cd5bafe..b8a163a 100644 (file)
@@ -26,8 +26,8 @@ Copyright (C) 2006-2008, Uri Shkolnik
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
-static struct list_head g_smsdvb_clients;
-static struct mutex g_smsdvb_clientslock;
+static LIST_HEAD(g_smsdvb_clients);
+static DEFINE_MUTEX(g_smsdvb_clientslock);
 
 static u32 sms_to_guard_interval_table[] = {
        [0] = GUARD_INTERVAL_1_32,
@@ -1236,9 +1236,6 @@ static int __init smsdvb_module_init(void)
 {
        int rc;
 
-       INIT_LIST_HEAD(&g_smsdvb_clients);
-       mutex_init(&g_smsdvb_clientslock);
-
        smsdvb_debugfs_register();
 
        rc = smscore_register_hotplug(smsdvb_hotplug);