[v2] mm/page_alloc: use free_area_empty() instead of open-coding
diff mbox series

Message ID 1583674354-7713-1-git-send-email-qiwuchen55@gmail.com
State New
Headers show
Series
  • [v2] mm/page_alloc: use free_area_empty() instead of open-coding
Related show

Commit Message

Qiwu Chen March 8, 2020, 1:32 p.m. UTC
From: chenqiwu <chenqiwu@xiaomi.com>

Use free_area_empty() API to replace list_empty() for better
code readability.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 mm/page_alloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Matthew Wilcox March 8, 2020, 2:03 p.m. UTC | #1
On Sun, Mar 08, 2020 at 09:32:34PM +0800, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> Use free_area_empty() API to replace list_empty() for better
> code readability.
> 
> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Patch
diff mbox series

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 79e950d..e78b780 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3533,8 +3533,7 @@  bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark,
 			return true;
 		}
 #endif
-		if (alloc_harder &&
-			!list_empty(&area->free_list[MIGRATE_HIGHATOMIC]))
+		if (alloc_harder && !free_area_empty(area, MIGRATE_HIGHATOMIC))
 			return true;
 	}
 	return false;