Skip to contentSkip to conversation

staging: speakup: Replaced obsolete simple_strtoul

PATCH In review Jitendra Khasdev 2 participants 2 messages Oct 5, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: speakup: Replaced obsolete simple_strtoul

From: Jitendra Kumar Khasdev <[email protected]>

This patch is for replacing obsolete simple_strtoul to kstrtoul which remove warning produce by checkpatch.

---
 drivers/staging/speakup/varhandlers.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/speakup/varhandlers.c +4 -2
index 21186e3..1a3caf3 100644
@@ -323,9 +323,11 @@ char *spk_strlwr(char *s)
 
 char *spk_s2uchar(char *start, char *dest)
 {
-	int val;
+	unsigned long val;
+
+	if (kstrtoul(start, 10, &val))
+		return NULL;
 
-	val = simple_strtoul(skip_spaces(start), &start, 10);
 	if (*start == ',')
 		start++;
 	*dest = (u_char)val;
Signature · 1 line
2.7.4
#1 lore raw

Hello,

drivers/staging/speakup/varhandlers.c char *spk_strlwr(char *s) · line 331

Quoted 11 lines · Jitendra Khasdev, on Thu 06 Oct 2016 02:02:58 +0530, wrote:

From: Jitendra Kumar Khasdev <[email protected]>

This patch is for replacing obsolete simple_strtoul to kstrtoul which remove warning produce by checkpatch.

drivers/staging/speakup/varhandlers.c +4 -1
+	unsigned long val;
+
+	if (kstrtoul(start, 10, &val))
+		return NULL;
 
-	val = simple_strtoul(skip_spaces(start), &start, 10);
 	if (*start == ',')

simple_strtoul modifies start, so you can't just replace it with kstrtoul.

Samuel