Skip to contentSkip to conversation

Change in comment for the list_empty() routine.

PATCH In review Nitin U. Yewale 2 participants 2 messages Mar 26, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Change in comment for the list_empty() routine.

Hello,

In one of the observations it was noticed that list_empty() routine returns true when the list is empty (head->next == head) OR False otherwise. Hence the proposed patch.

Thank you,
Nitin Yewale

---
 drivers/gpu/drm/nouveau/include/nvif/list.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/nouveau/include/nvif/list.h +1 -4
index 8af5d144ecb0..12bf7e3333e4 100644
@@ -226,10 +226,7 @@ static inline void list_move_tail(struct list_head *list,
 /**
  * Check if the list is empty.
  *
- * Example:
- * list_empty(&bar->list_of_foos);
- *
- * @return True if the list contains one or more elements or False otherwise.
+ * @return True if the list is empty (head->next == head) or False otherwise.
  */
 static inline bool
 list_empty(struct list_head *head)
Signature · 1 line
2.17.2
#1 lore raw
Quoted 5 lines · Nitin U. Yewale

Hello,

In one of the observations it was noticed that list_empty() routine returns true when the list is empty (head->next == head) OR False otherwise. Hence the proposed patch.

Hm, does anything use that file? It's almost impossible to have a translation unit that doesn't end up including linux/types.h since struct list_head is embedded in so many other structs. So if the nvif/list.h was also included by anything, I'd expect an immediate build failure (error: redefinition of ‘struct list_head’). Also, nothing under drivers/gpu does a #include of a list.h file that is not linux/list.h.

IOW, I suggest deleting drivers/gpu/drm/nouveau/include/nvif/list.h entirely.

Rasmus