Commit e7e09cd6 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

params.c: Use new strtobool function to process boolean inputs

No functional changes.
Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8705b48e
......@@ -297,21 +297,15 @@ EXPORT_SYMBOL(param_ops_charp);
int param_set_bool(const char *val, const struct kernel_param *kp)
{
bool v;
int ret;
/* No equals means "set"... */
if (!val) val = "1";
/* One of =[yYnN01] */
switch (val[0]) {
case 'y': case 'Y': case '1':
v = true;
break;
case 'n': case 'N': case '0':
v = false;
break;
default:
return -EINVAL;
}
ret = strtobool(val, &v);
if (ret)
return ret;
if (kp->flags & KPARAM_ISBOOL)
*(bool *)kp->arg = v;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment