提交 2a138dc7 编写于 作者: M Minfei Huang 提交者: Linus Torvalds

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.comSigned-off-by: NMinfei Huang <mnghuan@gmail.com>
Acked-by: NMichal Hocko <mhocko@suse.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 78ebc2f7
...@@ -613,14 +613,7 @@ static int __init early_debug_pagealloc(char *buf) ...@@ -613,14 +613,7 @@ static int __init early_debug_pagealloc(char *buf)
{ {
if (!buf) if (!buf)
return -EINVAL; return -EINVAL;
return kstrtobool(buf, &_debug_pagealloc_enabled);
if (strcmp(buf, "on") == 0)
_debug_pagealloc_enabled = true;
if (strcmp(buf, "off") == 0)
_debug_pagealloc_enabled = false;
return 0;
} }
early_param("debug_pagealloc", early_debug_pagealloc); early_param("debug_pagealloc", early_debug_pagealloc);
......
...@@ -13,13 +13,7 @@ static int early_page_poison_param(char *buf) ...@@ -13,13 +13,7 @@ static int early_page_poison_param(char *buf)
{ {
if (!buf) if (!buf)
return -EINVAL; return -EINVAL;
return strtobool(buf, &want_page_poisoning);
if (strcmp(buf, "on") == 0)
want_page_poisoning = true;
else if (strcmp(buf, "off") == 0)
want_page_poisoning = false;
return 0;
} }
early_param("page_poison", early_page_poison_param); early_param("page_poison", early_page_poison_param);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册