Skip to contentSkip to conversation

hlist constification

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hlist constification

From: Mitchell Blank Jr <[email protected]>

I posted a patch to consify 3 inline functions in <linux/list.h> to lkml on 9/1 but it looks like it slipped through the cracks. Looking at your trivial tree it seems that Inaky Perez-Gonzalez already submitted a patch to constify list_empty(). Here is a patch to do the other two. Should be non-controversial.

Patch is versus your current 2.6.0-test5-bk2 trivial tree.

-Mitch

include/linux/list.h renamed from include/linux/list.h.orig +2 -2
@@ -421,12 +421,12 @@
 #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) 
 #define INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL)
 
-static __inline__ int hlist_unhashed(struct hlist_node *h) 
+static __inline__ int hlist_unhashed(const struct hlist_node *h) 
 { 
 	return !h->pprev;
 } 
 
-static __inline__ int hlist_empty(struct hlist_head *h) 
+static __inline__ int hlist_empty(const struct hlist_head *h) 
 { 
 	return !h->first;
 } 
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: Mitchell Blank Jr <[email protected]>: [2.6 PATCH] hlist constification