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

lists: remove a redundant conditional definition of list_add()

Remove the conditional surrounding the definition of list_add() from list.h
since, if you define CONFIG_DEBUG_LIST, the definition you will subsequently
pick up from lib/list_debug.c will be absolutely identical, at which point you
can remove that redundant definition from list_debug.c as well.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Cc: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Robert P. J. Day and committed by
Linus Torvalds
e0ce0da9 fd193829

-18
-4
include/linux/list.h
··· 61 61 * Insert a new entry after the specified head. 62 62 * This is good for implementing stacks. 63 63 */ 64 - #ifndef CONFIG_DEBUG_LIST 65 64 static inline void list_add(struct list_head *new, struct list_head *head) 66 65 { 67 66 __list_add(new, head, head->next); 68 67 } 69 - #else 70 - extern void list_add(struct list_head *new, struct list_head *head); 71 - #endif 72 68 73 69 74 70 /**
-14
lib/list_debug.c
··· 40 40 EXPORT_SYMBOL(__list_add); 41 41 42 42 /** 43 - * list_add - add a new entry 44 - * @new: new entry to be added 45 - * @head: list head to add it after 46 - * 47 - * Insert a new entry after the specified head. 48 - * This is good for implementing stacks. 49 - */ 50 - void list_add(struct list_head *new, struct list_head *head) 51 - { 52 - __list_add(new, head, head->next); 53 - } 54 - EXPORT_SYMBOL(list_add); 55 - 56 - /** 57 43 * list_del - deletes entry from list. 58 44 * @entry: the element to delete from the list. 59 45 * Note: list_empty on entry does not return true after this, the entry is