Skip to contentSkip to conversation

list: leverage list_is_head() for list_entry_is_head()

PATCH Applied Wei Yang 1 participant 1 message Feb 8, 2024

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 list: leverage list_is_head() for list_entry_is_head()

This is what list_is_head() exactly do.

CC Andy Shevchenko <[email protected]>
CC Andrew Morton <[email protected]>
---
 include/linux/list.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/list.h +1 -1
index 059aa1fff41e..3dca3760f726 100644
@@ -766,7 +766,7 @@ static inline size_t list_count_nodes(struct list_head *head)
  * @member:	the name of the list_head within the struct.
  */
 #define list_entry_is_head(pos, head, member)				\
-	(&pos->member == (head))
+	list_is_head(&pos->member, (head))
 
 /**
  * list_for_each_entry	-	iterate over list of given type
Signature · 1 line
2.34.1