[PATCH] staging: speakup: replace simple_strtoul with kstrtoul

From: samuel kihahu
Date: Thu Dec 18 2014 - 09:42:37 EST


Replacing obsolete simple_strtoul with kstrtoul, checking and
returning the correct error code.

Signed-off-by: samuel kihahu <skihahu@xxxxxxxxx>
---
drivers/staging/speakup/varhandlers.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c
index d758284..716ccc1 100644
--- a/drivers/staging/speakup/varhandlers.c
+++ b/drivers/staging/speakup/varhandlers.c
@@ -321,9 +321,13 @@ char *spk_strlwr(char *s)

char *spk_s2uchar(char *start, char *dest)
{
- int val = 0;
+ unsigned long val;
+ int ret;
+
+ ret = kstrtoul(skip_spaces(start), 10, &val);
+ if (IS_ERR(&ret))
+ return ERR_CAST(&ret);

- val = simple_strtoul(skip_spaces(start), &start, 10);
if (*start == ',')
start++;
*dest = (u_char)val;
--
1.8.3.1


--TB36FDmn/VVEgNH/--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/