Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/char: use LIST_HEAD instead of LIST_HEAD_INIT

single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Denis Cheng and committed by
Linus Torvalds
bed9759b a18b630d

+4 -4
+1 -1
drivers/char/hvc_console.c
··· 93 93 }; 94 94 95 95 /* dynamic list of hvc_struct instances */ 96 - static struct list_head hvc_structs = LIST_HEAD_INIT(hvc_structs); 96 + static LIST_HEAD(hvc_structs); 97 97 98 98 /* 99 99 * Protect the list of hvc_struct instances from inserts and removals during
+1 -1
drivers/char/hvcs.c
··· 306 306 /* Required to back map a kref to its containing object */ 307 307 #define from_kref(k) container_of(k, struct hvcs_struct, kref) 308 308 309 - static struct list_head hvcs_structs = LIST_HEAD_INIT(hvcs_structs); 309 + static LIST_HEAD(hvcs_structs); 310 310 static DEFINE_SPINLOCK(hvcs_structs_lock); 311 311 312 312 static void hvcs_unthrottle(struct tty_struct *tty);
+2 -2
drivers/char/ipmi/ipmi_msghandler.c
··· 365 365 }; 366 366 static DEFINE_MUTEX(ipmidriver_mutex); 367 367 368 - static struct list_head ipmi_interfaces = LIST_HEAD_INIT(ipmi_interfaces); 368 + static LIST_HEAD(ipmi_interfaces); 369 369 static DEFINE_MUTEX(ipmi_interfaces_mutex); 370 370 371 371 /* List of watchers that want to know when smi's are added and 372 372 deleted. */ 373 - static struct list_head smi_watchers = LIST_HEAD_INIT(smi_watchers); 373 + static LIST_HEAD(smi_watchers); 374 374 static DEFINE_MUTEX(smi_watchers_mutex); 375 375 376 376