s390: use DEFINE_SPINLOCK for initialization
authorVineeth Vijayan <vneethv@linux.ibm.com>
Tue, 30 Mar 2021 18:46:57 +0000 (20:46 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 7 Apr 2021 13:24:56 +0000 (15:24 +0200)
For static initialization of spinlock_t variable, use DEFINE_SPINLOCK
instead of explicitly calling spin_lock_init().

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/char/con3215.c
drivers/s390/char/sclp_con.c
drivers/s390/char/sclp_tty.c
drivers/s390/char/sclp_vt220.c

index 671efee612af5e41e649d48de5957d6bd18dc066..9d3359b5b20ec85c575fa15c40746e921e7f1b1a 100644 (file)
@@ -99,7 +99,7 @@ static DEFINE_SPINLOCK(raw3215_device_lock);
 /* list of free request structures */
 static struct raw3215_req *raw3215_freelist;
 /* spinlock to protect free list */
-static spinlock_t raw3215_freelist_lock;
+static DEFINE_SPINLOCK(raw3215_freelist_lock);
 
 static struct tty_driver *tty3215_driver;
 
@@ -850,7 +850,6 @@ static int __init con3215_init(void)
 
        /* allocate 3215 request structures */
        raw3215_freelist = NULL;
-       spin_lock_init(&raw3215_freelist_lock);
        for (i = 0; i < NR_3215_REQ; i++) {
                req = kzalloc(sizeof(struct raw3215_req), GFP_KERNEL | GFP_DMA);
                if (!req)
index 8c5c95bf89e08c59c54a6135acc72fca17d55edb..f5e34e1b6c9e8ffc42a7b56684b0a18b616de2c3 100644 (file)
@@ -26,7 +26,7 @@
 #define sclp_console_name  "ttyS"
 
 /* Lock to guard over changes to global variables */
-static spinlock_t sclp_con_lock;
+static DEFINE_SPINLOCK(sclp_con_lock);
 /* List of free pages that can be used for console output buffering */
 static struct list_head sclp_con_pages;
 /* List of full struct sclp_buffer structures ready for output */
@@ -329,7 +329,6 @@ sclp_console_init(void)
                list_add_tail(page, &sclp_con_pages);
        }
        INIT_LIST_HEAD(&sclp_con_outqueue);
-       spin_lock_init(&sclp_con_lock);
        sclp_conbuf = NULL;
        timer_setup(&sclp_con_timer, sclp_console_timeout, 0);
 
index 4af8084df16947da4273058ece128326d9fc5056..cf73fc3fd0f92f5b35b38509e7b36124f9d891cc 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 /* Lock to guard over changes to global variables. */
-static spinlock_t sclp_tty_lock;
+static DEFINE_SPINLOCK(sclp_tty_lock);
 /* List of free pages that can be used for console output buffering. */
 static struct list_head sclp_tty_pages;
 /* List of full struct sclp_buffer structures ready for output. */
@@ -526,7 +526,6 @@ sclp_tty_init(void)
                list_add_tail((struct list_head *) page, &sclp_tty_pages);
        }
        INIT_LIST_HEAD(&sclp_tty_outqueue);
-       spin_lock_init(&sclp_tty_lock);
        timer_setup(&sclp_tty_timer, sclp_tty_timeout, 0);
        sclp_ttybuf = NULL;
        sclp_tty_buffer_count = 0;
index 047f812d1a1c89fb5ee679140572ec58c30a899d..3a6e0af436f4fae4d0398e3683121866c90b4483 100644 (file)
@@ -61,7 +61,7 @@ static struct tty_driver *sclp_vt220_driver;
 static struct tty_port sclp_vt220_port;
 
 /* Lock to protect internal data from concurrent access */
-static spinlock_t sclp_vt220_lock;
+static DEFINE_SPINLOCK(sclp_vt220_lock);
 
 /* List of empty pages to be used as write request buffers */
 static struct list_head sclp_vt220_empty;
@@ -693,7 +693,6 @@ static int __init __sclp_vt220_init(int num_pages)
        sclp_vt220_init_count++;
        if (sclp_vt220_init_count != 1)
                return 0;
-       spin_lock_init(&sclp_vt220_lock);
        INIT_LIST_HEAD(&sclp_vt220_empty);
        INIT_LIST_HEAD(&sclp_vt220_outqueue);
        timer_setup(&sclp_vt220_timer, sclp_vt220_timeout, 0);