Commit 5f0917a2 authored by Vasily Gorbik's avatar Vasily Gorbik
Browse files

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: default avatarPhilipp Rudo <prudo@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 3d644364
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -21,18 +21,12 @@ 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;
	if (!kstrtobool(str, &enabled))
		cmma_flag = enabled;
	return 1;
}
	cmma_flag = 0;
	if (strcmp(parm, "no") == 0 || strcmp(parm, "off") == 0)
		return 1;
	return 0;
}
__setup("cmma=", cmma);

static inline int cmma_test_essa(void)