summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <linux@treblig.org>2022-03-23 00:48:04 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-23 01:57:11 +0300
commit597da28e1abb4ad9f7255cbb57354158fd853e19 (patch)
tree10c27024b1adce617f722479535425eff7c5ec26 /mm
parent7a3f2263d72d5055a56bc52ce97f5ded7853a41e (diff)
downloadlinux-597da28e1abb4ad9f7255cbb57354158fd853e19.tar.xz
mm/page_table_check.c: use strtobool for param parsing
Use strtobool rather than open coding "on" and "off" parsing. Link: https://lkml.kernel.org/r/20220227181038.126926-1-linux@treblig.org Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_table_check.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/mm/page_table_check.c b/mm/page_table_check.c
index 3763bd077861..2458281bff89 100644
--- a/mm/page_table_check.c
+++ b/mm/page_table_check.c
@@ -23,15 +23,7 @@ EXPORT_SYMBOL(page_table_check_disabled);
static int __init early_page_table_check_param(char *buf)
{
- if (!buf)
- return -EINVAL;
-
- if (strcmp(buf, "on") == 0)
- __page_table_check_enabled = true;
- else if (strcmp(buf, "off") == 0)
- __page_table_check_enabled = false;
-
- return 0;
+ return strtobool(buf, &__page_table_check_enabled);
}
early_param("page_table_check", early_page_table_check_param);