diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-04-19 12:43:47 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-25 16:04:52 -0700 |
commit | e7e09cd667a43d8287f85d453a16fc0ec1e2c7b7 (patch) | |
tree | 29ec5f4bd232b467cc6b064c647b6c4990e9ca79 | |
parent | 8705b48e7159655c116154928fe104fd6561fa94 (diff) | |
download | kernel_samsung_tuna-e7e09cd667a43d8287f85d453a16fc0ec1e2c7b7.zip kernel_samsung_tuna-e7e09cd667a43d8287f85d453a16fc0ec1e2c7b7.tar.gz kernel_samsung_tuna-e7e09cd667a43d8287f85d453a16fc0ec1e2c7b7.tar.bz2 |
params.c: Use new strtobool function to process boolean inputs
No functional changes.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | kernel/params.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/kernel/params.c b/kernel/params.c index 7ab388a..6888761 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -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; |