From 456d57a4dffc3231b7fe10714189736cf53c3320 Mon Sep 17 00:00:00 2001 From: Sumit Singh Date: Mon, 21 Apr 2014 15:22:15 +0530 Subject: llist: defining relaxed version of llist_empty Defining relaxed version of llist_empty as llist_empty_relaxed, which will be used for power-optimization. bug 1440421 Change-Id: I1c4c34b381e49775ed08ddd606d9744a7e7e1fba Signed-off-by: Sumit Singh Reviewed-on: http://git-master/r/426483 Reviewed-by: Sri Krishna Chowdary GVS: Gerrit_Virtual_Submit Reviewed-by: Alexander Van Brunt Signed-off-by: franciscofranco --- include/linux/llist.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux') diff --git a/include/linux/llist.h b/include/linux/llist.h index 97cf31da6..197228346 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h @@ -57,6 +57,7 @@ #include #include +#include struct llist_head { struct llist_node *first; @@ -160,6 +161,11 @@ static inline bool llist_empty(const struct llist_head *head) return ACCESS_ONCE(head->first) == NULL; } +static inline bool llist_empty_relaxed(const struct llist_head *head) +{ + return (void *)cpu_relaxed_read_long(&head->first) == NULL; +} + static inline struct llist_node *llist_next(struct llist_node *node) { return node->next; -- cgit v1.2.3