All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: speakup: Replace simple_strtoul by kstrtoul
@ 2017-04-27 16:52 Shekhar Bhandakkar
  2017-04-27 21:58 ` Samuel Thibault
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Shekhar Bhandakkar @ 2017-04-27 16:52 UTC (permalink / raw)
  To: kernel-janitors

The simple_strtoul function is obsolete.
This patch replaces it by kstrtoul.

Signed-off-by: Shekhar Bhandakkar <cs14btech11006@iith.ac.in>
---
 drivers/staging/speakup/kobjects.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c
index ca85476..8b9ddb9 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -127,6 +127,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
 	int do_characters = !strcmp(attr->attr.name, "characters");
 	size_t desc_length = 0;
 	int i;
+	int err;
 
 	spin_lock_irqsave(&speakup_info.spinlock, flags);
 	while (cp < end) {
@@ -153,7 +154,9 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
 			continue;
 		}
 
-		index = simple_strtoul(cp, &temp, 10);
+		err = kstrtoul(cp, 10, &index);
+		if (err)
+			return err;
 		if (index > 255) {
 			rejected++;
 			cp = linefeed + 1;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] staging: speakup: Replace simple_strtoul by kstrtoul
@ 2016-09-12 20:50 Gargi Sharma
       [not found] ` <20160912205630.GG5245@var.home>
  0 siblings, 1 reply; 7+ messages in thread
From: Gargi Sharma @ 2016-09-12 20:50 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: w.d.hubbs, chris, kirk, samuel.thibault, gregkh, Gargi Sharma

simple_strtoul is obsolete and hence has been replaced by kstrtoul as
mentioned by checkpatch.pl

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
---
 drivers/staging/speakup/kobjects.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c
index 528cbdc..884b2eb 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -126,6 +126,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
 	int do_characters = !strcmp(attr->attr.name, "characters");
 	size_t desc_length = 0;
 	int i;
+	int err;
 
 	spin_lock_irqsave(&speakup_info.spinlock, flags);
 	while (cp < end) {
@@ -153,7 +154,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
 			continue;
 		}
 
-		index = simple_strtoul(cp, &temp, 10);
+		err = kstrtoul(cp, 10, &index);
 		if (index > 255) {
 			rejected++;
 			cp = linefeed + 1;
@@ -757,6 +758,7 @@ static ssize_t message_store_helper(const char *buf, size_t count,
 	enum msg_index_t firstmessage = group->start;
 	enum msg_index_t lastmessage = group->end;
 	enum msg_index_t curmessage;
+	int err;
 
 	while (cp < end) {
 
@@ -783,7 +785,7 @@ static ssize_t message_store_helper(const char *buf, size_t count,
 			continue;
 		}
 
-		index = simple_strtoul(cp, &temp, 10);
+		err = kstrtoul(cp, 10, &index);
 
 		while ((temp < linefeed) && (*temp == ' ' || *temp == '\t'))
 			temp++;
-- 
2.9.2



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-05-22 14:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-27 16:52 [PATCH] staging: speakup: Replace simple_strtoul by kstrtoul Shekhar Bhandakkar
2017-04-27 21:58 ` Samuel Thibault
2017-04-28  3:50 ` Shekhar Bhandakkar
2017-04-28  5:26 ` Julia Lawall
2017-05-22 14:57 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2016-09-12 20:50 Gargi Sharma
     [not found] ` <20160912205630.GG5245@var.home>
2016-09-13  6:32   ` Gargi Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.