From: Dr. David Alan Gilbert Date: Tue, 22 Mar 2022 21:48:04 +0000 (-0700) Subject: mm/page_table_check.c: use strtobool for param parsing X-Git-Tag: v5.18-rc1~168^2~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=597da28e1abb4ad9f7255cbb57354158fd853e19;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_table_check.c b/mm/page_table_check.c index 3763bd077861a..2458281bff893 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);