diff options
author | 2019-08-19 17:55:44 +0200 | |
---|---|---|
committer | 2019-08-26 12:51:18 +0200 | |
commit | 5f0917a281c66fb310988d4c38f3c55b7023b8ff (patch) | |
tree | 6e16b0e24545f26d943d8d437c8787814bc5adae /arch | |
parent | s390/vdso: reuse kstrtobool for option value parsing (diff) | |
download | linux-5f0917a281c66fb310988d4c38f3c55b7023b8ff.tar.gz linux-5f0917a281c66fb310988d4c38f3c55b7023b8ff.tar.bz2 linux-5f0917a281c66fb310988d4c38f3c55b7023b8ff.zip |
s390/cmma: reuse kstrtobool for option value parsing
"cmma" option setup already recognises some textual values. Yet kstrtobool
is a more common way to parse boolean values, reuse it to unify option
value parsing behavior and simplify code a bit.
While at it, __setup value parsing callbacks are expected to return
1 when an option is recognized, and returning any other value won't
trigger any error message currently, so simply return 1.
Reviewed-by: Philipp Rudo <prudo@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/mm/page-states.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/s390/mm/page-states.c b/arch/s390/mm/page-states.c index dc3cede7f2ec..fc141893d028 100644 --- a/arch/s390/mm/page-states.c +++ b/arch/s390/mm/page-states.c @@ -21,17 +21,11 @@ static int cmma_flag = 1; static int __init cmma(char *str) { - char *parm; + bool enabled; - parm = strstrip(str); - if (strcmp(parm, "yes") == 0 || strcmp(parm, "on") == 0) { - cmma_flag = 1; - return 1; - } - cmma_flag = 0; - if (strcmp(parm, "no") == 0 || strcmp(parm, "off") == 0) - return 1; - return 0; + if (!kstrtobool(str, &enabled)) + cmma_flag = enabled; + return 1; } __setup("cmma=", cmma); |