s390/sclp: use LIST_HEAD for Initialization

For static initialization of list_head variable, use LIST_HEAD
instead of INIT_LIST_HEAD function.

Suggested-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
Vineeth Vijayan 2021-03-31 15:43:40 +02:00 committed by Heiko Carstens
parent 7dd8ed0943
commit 8bc00c04d8
4 changed files with 8 additions and 16 deletions

View File

@ -37,10 +37,10 @@ static sccb_mask_t sclp_receive_mask;
static sccb_mask_t sclp_send_mask;
/* List of registered event listeners and senders. */
static struct list_head sclp_reg_list;
static LIST_HEAD(sclp_reg_list);
/* List of queued requests. */
static struct list_head sclp_req_queue;
static LIST_HEAD(sclp_req_queue);
/* Data for read and and init requests. */
static struct sclp_req sclp_read_req;
@ -1178,8 +1178,6 @@ sclp_init(void)
sclp_init_sccb = (void *) __get_free_page(GFP_ATOMIC | GFP_DMA);
BUG_ON(!sclp_read_sccb || !sclp_init_sccb);
/* Set up variables */
INIT_LIST_HEAD(&sclp_req_queue);
INIT_LIST_HEAD(&sclp_reg_list);
list_add(&sclp_state_change_event.list, &sclp_reg_list);
timer_setup(&sclp_request_timer, NULL, 0);
timer_setup(&sclp_queue_timer, sclp_req_queue_timeout, 0);

View File

@ -28,9 +28,9 @@
/* Lock to guard over changes to global variables */
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;
static LIST_HEAD(sclp_con_pages);
/* List of full struct sclp_buffer structures ready for output */
static struct list_head sclp_con_outqueue;
static LIST_HEAD(sclp_con_outqueue);
/* Pointer to current console buffer */
static struct sclp_buffer *sclp_conbuf;
/* Timer for delayed output of console messages */
@ -323,12 +323,10 @@ sclp_console_init(void)
if (rc)
return rc;
/* Allocate pages for output buffering */
INIT_LIST_HEAD(&sclp_con_pages);
for (i = 0; i < sclp_console_pages; i++) {
page = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
list_add_tail(page, &sclp_con_pages);
}
INIT_LIST_HEAD(&sclp_con_outqueue);
sclp_conbuf = NULL;
timer_setup(&sclp_con_timer, sclp_console_timeout, 0);

View File

@ -37,9 +37,9 @@
/* Lock to guard over changes to global variables. */
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;
static LIST_HEAD(sclp_tty_pages);
/* List of full struct sclp_buffer structures ready for output. */
static struct list_head sclp_tty_outqueue;
static LIST_HEAD(sclp_tty_outqueue);
/* Counter how many buffers are emitted. */
static int sclp_tty_buffer_count;
/* Pointer to current console buffer. */
@ -516,7 +516,6 @@ sclp_tty_init(void)
return rc;
}
/* Allocate pages for output buffering */
INIT_LIST_HEAD(&sclp_tty_pages);
for (i = 0; i < MAX_KMEM_PAGES; i++) {
page = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
if (page == NULL) {
@ -525,7 +524,6 @@ sclp_tty_init(void)
}
list_add_tail((struct list_head *) page, &sclp_tty_pages);
}
INIT_LIST_HEAD(&sclp_tty_outqueue);
timer_setup(&sclp_tty_timer, sclp_tty_timeout, 0);
sclp_ttybuf = NULL;
sclp_tty_buffer_count = 0;

View File

@ -64,10 +64,10 @@ static struct tty_port sclp_vt220_port;
static DEFINE_SPINLOCK(sclp_vt220_lock);
/* List of empty pages to be used as write request buffers */
static struct list_head sclp_vt220_empty;
static LIST_HEAD(sclp_vt220_empty);
/* List of pending requests */
static struct list_head sclp_vt220_outqueue;
static LIST_HEAD(sclp_vt220_outqueue);
/* Suspend mode flag */
static int sclp_vt220_suspended;
@ -693,8 +693,6 @@ static int __init __sclp_vt220_init(int num_pages)
sclp_vt220_init_count++;
if (sclp_vt220_init_count != 1)
return 0;
INIT_LIST_HEAD(&sclp_vt220_empty);
INIT_LIST_HEAD(&sclp_vt220_outqueue);
timer_setup(&sclp_vt220_timer, sclp_vt220_timeout, 0);
tty_port_init(&sclp_vt220_port);
sclp_vt220_current_request = NULL;