OSDN Git Service

mISDN: Use DEFINE_SPINLOCK() for spinlock
authorShixin Liu <liushixin2@huawei.com>
Tue, 30 Mar 2021 02:24:14 +0000 (10:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Mar 2021 20:34:42 +0000 (13:34 -0700)
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Changelog:
From v1:
1. fix the mistake reported by kernel test robot.

Signed-off-by: Shixin Liu <liushixin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/hardware/mISDN/hfcmulti.c
drivers/isdn/mISDN/dsp_core.c
drivers/isdn/mISDN/l1oip_core.c

index 1409215..4f7eaa1 100644 (file)
 #define        MAX_FRAGS       (32 * MAX_CARDS)
 
 static LIST_HEAD(HFClist);
-static spinlock_t HFClock; /* global hfc list lock */
+static DEFINE_SPINLOCK(HFClock); /* global hfc list lock */
 
 static void ph_state_change(struct dchannel *);
 
 static struct hfc_multi *syncmaster;
 static int plxsd_master; /* if we have a master card (yet) */
-static spinlock_t plx_lock; /* may not acquire other lock inside */
+static DEFINE_SPINLOCK(plx_lock); /* may not acquire other lock inside */
 
 #define        TYP_E1          1
 #define        TYP_4S          4
@@ -5480,9 +5480,6 @@ HFCmulti_init(void)
        printk(KERN_DEBUG "%s: IRQ_DEBUG IS ENABLED!\n", __func__);
 #endif
 
-       spin_lock_init(&HFClock);
-       spin_lock_init(&plx_lock);
-
        if (debug & DEBUG_HFCMULTI_INIT)
                printk(KERN_DEBUG "%s: init entered\n", __func__);
 
index 4946ea1..8766095 100644 (file)
@@ -176,7 +176,7 @@ MODULE_LICENSE("GPL");
 
 /*int spinnest = 0;*/
 
-spinlock_t dsp_lock; /* global dsp lock */
+DEFINE_SPINLOCK(dsp_lock); /* global dsp lock */
 struct list_head dsp_ilist;
 struct list_head conf_ilist;
 int dsp_debug;
@@ -1169,7 +1169,6 @@ static int __init dsp_init(void)
        printk(KERN_INFO "mISDN_dsp: DSP clocks every %d samples. This equals "
               "%d jiffies.\n", dsp_poll, dsp_tics);
 
-       spin_lock_init(&dsp_lock);
        INIT_LIST_HEAD(&dsp_ilist);
        INIT_LIST_HEAD(&conf_ilist);
 
index facbd88..62fad8f 100644 (file)
 static const char *l1oip_revision = "2.00";
 
 static int l1oip_cnt;
-static spinlock_t l1oip_lock;
+static DEFINE_SPINLOCK(l1oip_lock);
 static struct list_head l1oip_ilist;
 
 #define MAX_CARDS      16
@@ -1441,7 +1441,6 @@ l1oip_init(void)
               l1oip_revision);
 
        INIT_LIST_HEAD(&l1oip_ilist);
-       spin_lock_init(&l1oip_lock);
 
        if (l1oip_4bit_alloc(ulaw))
                return -ENOMEM;