Commit deaf386e authored by Gavin Shan's avatar Gavin Shan Committed by Linus Torvalds

mm/buddy: cleanup on should_fail_alloc_page

Currently, function should_fail() has "bool" for its return value, so it's
reasonable to change the return value of function should_fail_alloc_page()
into "bool" as well.

The patch does cleanup on function should_fail_alloc_page() to have "bool"
for its return value.
Signed-off-by: default avatarGavin Shan <shangw@linux.vnet.ibm.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 44de9d0c
...@@ -1529,16 +1529,16 @@ static int __init setup_fail_page_alloc(char *str) ...@@ -1529,16 +1529,16 @@ static int __init setup_fail_page_alloc(char *str)
} }
__setup("fail_page_alloc=", setup_fail_page_alloc); __setup("fail_page_alloc=", setup_fail_page_alloc);
static int should_fail_alloc_page(gfp_t gfp_mask, unsigned int order) static bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
{ {
if (order < fail_page_alloc.min_order) if (order < fail_page_alloc.min_order)
return 0; return false;
if (gfp_mask & __GFP_NOFAIL) if (gfp_mask & __GFP_NOFAIL)
return 0; return false;
if (fail_page_alloc.ignore_gfp_highmem && (gfp_mask & __GFP_HIGHMEM)) if (fail_page_alloc.ignore_gfp_highmem && (gfp_mask & __GFP_HIGHMEM))
return 0; return false;
if (fail_page_alloc.ignore_gfp_wait && (gfp_mask & __GFP_WAIT)) if (fail_page_alloc.ignore_gfp_wait && (gfp_mask & __GFP_WAIT))
return 0; return false;
return should_fail(&fail_page_alloc.attr, 1 << order); return should_fail(&fail_page_alloc.attr, 1 << order);
} }
...@@ -1578,9 +1578,9 @@ late_initcall(fail_page_alloc_debugfs); ...@@ -1578,9 +1578,9 @@ late_initcall(fail_page_alloc_debugfs);
#else /* CONFIG_FAIL_PAGE_ALLOC */ #else /* CONFIG_FAIL_PAGE_ALLOC */
static inline int should_fail_alloc_page(gfp_t gfp_mask, unsigned int order) static inline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
{ {
return 0; return false;
} }
#endif /* CONFIG_FAIL_PAGE_ALLOC */ #endif /* CONFIG_FAIL_PAGE_ALLOC */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment