Skip to content

Commit deaf386

Browse files
shangwtorvalds
authored andcommitted
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: Gavin Shan <shangw@linux.vnet.ibm.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 44de9d0 commit deaf386

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎mm/page_alloc.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,16 +1529,16 @@ static int __init setup_fail_page_alloc(char *str)
15291529
}
15301530
__setup("fail_page_alloc=", setup_fail_page_alloc);
15311531

1532-
static int should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
1532+
static bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
15331533
{
15341534
if (order < fail_page_alloc.min_order)
1535-
return 0;
1535+
return false;
15361536
if (gfp_mask & __GFP_NOFAIL)
1537-
return 0;
1537+
return false;
15381538
if (fail_page_alloc.ignore_gfp_highmem && (gfp_mask & __GFP_HIGHMEM))
1539-
return 0;
1539+
return false;
15401540
if (fail_page_alloc.ignore_gfp_wait && (gfp_mask & __GFP_WAIT))
1541-
return 0;
1541+
return false;
15421542

15431543
return should_fail(&fail_page_alloc.attr, 1 << order);
15441544
}
@@ -1578,9 +1578,9 @@ late_initcall(fail_page_alloc_debugfs);
15781578

15791579
#else /* CONFIG_FAIL_PAGE_ALLOC */
15801580

1581-
static inline int should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
1581+
static inline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
15821582
{
1583-
return 0;
1583+
return false;
15841584
}
15851585

15861586
#endif /* CONFIG_FAIL_PAGE_ALLOC */

0 commit comments

Comments
 (0)