Skip to contentSkip to conversation

mm/page_reporting: use list_entry_is_head() in page_reporting_cycle()

PATCH Applied sh 2 participants 2 messages Dec 22, 2020 – Dec 29, 2020

Subsystems (2)
lore
Share & tools
lore

sh

author
#0 lore raw

PATCH 1/1 mm/page_reporting: use list_entry_is_head() in page_reporting_cycle()

replace '&next->lru != list' with list_entry_is_head(). No functional change.

---
 mm/page_reporting.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_reporting.c +1 -1
index cd8e13d41df4..c50d93ffa252 100644
@@ -211,7 +211,7 @@ page_reporting_cycle(struct page_reporting_dev_info *prdev, struct zone *zone,
 	}
 
 	/* Rotate any leftover pages to the head of the freelist */
-	if (&next->lru != list && !list_is_first(&next->lru, list))
+	if (!list_entry_is_head(next, list, lru) && !list_is_first(&next->lru, list))
 		list_rotate_to_front(&next->lru, list);
 
 	spin_unlock_irq(&zone->lock);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · sh

replace '&next->lru != list' with list_entry_is_head(). No functional change.

---
 mm/page_reporting.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_reporting.c +0 -0
index cd8e13d41df4..c50d93ffa252 100644

mm/page_reporting.c page_reporting_cycle(struct page_reporting_dev_info *prdev, struct zone *zone, · line 217

Quoted 8 lines
mm/page_reporting.c +1 -1
@@ -211,7 +211,7 @@ page_reporting_cycle(struct page_reporting_dev_info *prdev, struct zone *zone,
 	}
 
 	/* Rotate any leftover pages to the head of the freelist */
-	if (&next->lru != list && !list_is_first(&next->lru, list))
+	if (!list_entry_is_head(next, list, lru) && !list_is_first(&next->lru, list))
 		list_rotate_to_front(&next->lru, list);
 
 	spin_unlock_irq(&zone->lock);

LGTM

Signature · 3 lines
Thanks,

David / dhildenb