mm: use existing helper to convert "on"/"off" to boolean
Subsystems (2)
[email protected]
maintainerPATCH 37/162 mm: use existing helper to convert "on"/"off" to boolean
From: Minfei Huang <[email protected]>
Subject: 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.
Signed-off-by Minfei Huang <[email protected]>
Acked-by Michal Hocko <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/page_alloc.c | 9 +-------- mm/page_poison.c | 8 +------- 2 files changed, 2 insertions(+), 15 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~use-existing-helper-to-convert-on-off-to-boolean +1 -8
@@ -613,14 +613,7 @@ static int __init early_debug_pagealloc( {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);
mm/page_poison.c renamed from mm/page_poison.c~use-existing-helper-to-convert-on-off-to-boolean +0 -5
@@ -13,13 +13,7 @@ static int early_page_poison_param(char {if (!buf)return -EINVAL ; - -if (strcmp (buf,"on" ) ==0 ) - want_page_poisoning = true; -else if (strcmp (buf,"off" ) ==0 ) - want_page_poisoning = false;