mm/page_alloc: make bad_range() return bool
authorHao Ge <gehao@kylinos.cn>
Wed, 21 Feb 2024 07:32:27 +0000 (15:32 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 24 Feb 2024 01:48:34 +0000 (17:48 -0800)
bad_range() can return bool, so let us change it.

Link: https://lkml.kernel.org/r/20240221073227.276234-1-gehao@kylinos.cn
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index 51e13aa605ecbd55a0d4ad30586485ee51e6e379..a9581cdf9649aea50cc2887b17080ac62d99c0d4 100644 (file)
@@ -464,19 +464,19 @@ static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
 /*
  * Temporary debugging check for pages not lying within a given zone.
  */
-static int __maybe_unused bad_range(struct zone *zone, struct page *page)
+static bool __maybe_unused bad_range(struct zone *zone, struct page *page)
 {
        if (page_outside_zone_boundaries(zone, page))
-               return 1;
+               return true;
        if (zone != page_zone(page))
-               return 1;
+               return true;
 
-       return 0;
+       return false;
 }
 #else
-static inline int __maybe_unused bad_range(struct zone *zone, struct page *page)
+static inline bool __maybe_unused bad_range(struct zone *zone, struct page *page)
 {
-       return 0;
+       return false;
 }
 #endif