summaryrefslogtreecommitdiff
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorMinfei Huang <mnghuan@gmail.com>2016-05-20 16:58:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-20 17:58:30 -0700
commit2a138dc7e50bfdc90f9db9b52584ac5564952425 (patch)
tree48d3d1a4e3092a1a09cae17da06f849e9f3b455a /mm/page_alloc.c
parent78ebc2f7146156f488083c9e5a7ded9d5c38c58b (diff)
downloadlinux-next-2a138dc7e50bfdc90f9db9b52584ac5564952425.tar.gz
mm: use existing helper to convert "on"/"off" to boolean
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>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7e49bc3705b6..3f4b69aaa23a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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);