Skip to contentSkip to conversation

Remove a redundant conditional definition of list_add().

PATCH New Robert P. J. Day 1 participant 1 message Apr 25, 2008 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
compile-tested on x86 with "make defconfig", both with and without
the list debug option.

 include/linux/list.h |    4 ----
 lib/list_debug.c     |   14 --------------
 2 files changed, 18 deletions(-)
include/linux/list.h +0 -4
index dac16f9..2febfe1 100644
@@ -63,14 +63,10 @@ extern void __list_add(struct list_head *new,
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
  */
-#ifndef CONFIG_DEBUG_LIST
 static inline void list_add(struct list_head *new, struct list_head *head)
 {
 	__list_add(new, head, head->next);
 }
-#else
-extern void list_add(struct list_head *new, struct list_head *head);
-#endif
 
 
 /**
lib/list_debug.c +0 -14
index 4350ba9..45c03fd 100644
@@ -40,20 +40,6 @@ void __list_add(struct list_head *new,
 EXPORT_SYMBOL(__list_add);
 
 /**
- * list_add - add a new entry
- * @new: new entry to be added
- * @head: list head to add it after
- *
- * Insert a new entry after the specified head.
- * This is good for implementing stacks.
- */
-void list_add(struct list_head *new, struct list_head *head)
-{
-	__list_add(new, head, head->next);
-}
-EXPORT_SYMBOL(list_add);
-
-/**
  * list_del - deletes entry from list.
  * @entry: the element to delete from the list.
  * Note: list_empty on entry does not return true after this, the entry is

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================