summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAshvini Varatharaj <ashvinivaratharaj@gmail.com>2013-10-19 20:58:26 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-19 14:51:06 -0700
commita8eecad5c906707475a2141133fe43710e5f5e85 (patch)
treeb0e2d5cac86ce0b589ec26bcba32db268a684445 /drivers
parent1b7e763140d0767485ac87b6bb7c07ea29a27e78 (diff)
downloadop-kernel-dev-a8eecad5c906707475a2141133fe43710e5f5e85.zip
op-kernel-dev-a8eecad5c906707475a2141133fe43710e5f5e85.tar.gz
Staging: speakup: replacing simple_strtoul with kstrtoul
Fix checkpatch warning: WARNING: simple_strtoul is obsolete, use kstrtoul instead Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/speakup/kobjects.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c
index f31afa2..e2f597e 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -616,7 +616,7 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
int len;
char *cp;
struct var_t *var_data;
- int value;
+ long value;
unsigned long flags;
param = spk_var_header_by_name(attr->attr.name);
@@ -638,8 +638,10 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
len = E_INC;
else
len = E_SET;
- value = simple_strtol(cp, NULL, 10);
- ret = spk_set_num_var(value, param, len);
+ if (kstrtol(cp, 10, &value) == 0)
+ ret = spk_set_num_var(value, param, len);
+ else
+ pr_warn("overflow or parsing error has occured");
if (ret == -ERANGE) {
var_data = param->data;
pr_warn("value for %s out of range, expect %d to %d\n",
OpenPOWER on IntegriCloud