Skip to content

Commit

Permalink
mm: use existing helper to convert "on"/"off" to boolean
Browse files Browse the repository at this point in the history
It's more convenient to use existing function helper to convert string
"on/off" to boolean.

Link: http://lkml.kernel.org/r/1461908824-16129-1-git-send-email-mnghuan@gmail.com
Signed-off-by: Minfei Huang <mnghuan@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Minfei Huang authored and torvalds committed May 21, 2016
1 parent 78ebc2f commit 2a138dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
9 changes: 1 addition & 8 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,7 @@ static int __init early_debug_pagealloc(char *buf)
{
if (!buf)
return -EINVAL;

if (strcmp(buf, "on") == 0)
_debug_pagealloc_enabled = true;

if (strcmp(buf, "off") == 0)
_debug_pagealloc_enabled = false;

return 0;
return kstrtobool(buf, &_debug_pagealloc_enabled);
}
early_param("debug_pagealloc", early_debug_pagealloc);

Expand Down
8 changes: 1 addition & 7 deletions mm/page_poison.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ static int early_page_poison_param(char *buf)
{
if (!buf)
return -EINVAL;

if (strcmp(buf, "on") == 0)
want_page_poisoning = true;
else if (strcmp(buf, "off") == 0)
want_page_poisoning = false;

return 0;
return strtobool(buf, &want_page_poisoning);
}
early_param("page_poison", early_page_poison_param);

Expand Down

0 comments on commit 2a138dc

Please sign in to comment.