[PATCH 6/5] llist: Add llist_next()

From: Peter Zijlstra
Date: Mon Sep 12 2011 - 10:06:16 EST


Subject: llist: Add llist_next()
From: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Date: Mon Sep 12 13:12:28 CEST 2011

So we don't have to expose the struct list_node members

Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
include/linux/llist.h | 5 +++++
kernel/irq_work.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
Index: linux-2.6/include/linux/llist.h
===================================================================
--- linux-2.6.orig/include/linux/llist.h
+++ linux-2.6/include/linux/llist.h
@@ -144,6 +144,11 @@ static inline bool llist_empty(const str
return ACCESS_ONCE(head->first) == NULL;
}

+static inline struct llist_node *llist_next(struct llist_node *node)
+{
+ return node->next;
+}
+
/**
* llist_add - add a new entry
* @new: new entry to be added
Index: linux-2.6/kernel/irq_work.c
===================================================================
--- linux-2.6.orig/kernel/irq_work.c
+++ linux-2.6/kernel/irq_work.c
@@ -110,7 +110,7 @@ void irq_work_run(void)
while (llnode != NULL) {
work = llist_entry(llnode, struct irq_work, llnode);

- llnode = llnode->next;
+ llnode = llist_next(llnode);

/*
* Clear the PENDING bit, after this point the @work

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/