Skip to contentSkip to conversation

Change list_emtpy() to take a const pointer

PATCH New Rusty Trivial Russell 1 participant 1 message Oct 5, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Change list_emtpy() to take a const pointer

From: "Perez-Gonzalez, Inaky" <[email protected]>

Hi Rusty, list

Didn't know what was the best place to submit this one, I guessed trivial.

Just change the definition of list_empty() to take a const pointer. I have some upper layers of code that do all the const/non-const thing and list_empty() breaks it without this.

include/linux/list.h renamed from include/linux/list.h.orig +1 -1
@@ -203,7 +203,7 @@
  * list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static inline int list_empty(struct list_head *head)
+static inline int list_empty(const struct list_head *head)
 {
 	return head->next == head;
 }
Signature · 3 lines
  What is this? http://www.kernel.org/pub/linux/kernel/people/rusty/trivial/
  Don't blame me: the Monkey is driving
  File: "Perez-Gonzalez, Inaky" <[email protected]>: [2.{4,5} TRIVIAL PATCH] Change list_emtpy() to take a const pointer