All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shekhar Bhandakkar <cs14btech11006@iith.ac.in>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH] staging: speakup: Replace simple_strtoul by kstrtoul
Date: Fri, 28 Apr 2017 03:50:22 +0000	[thread overview]
Message-ID: <20170428035012.GA1319@gmail.com> (raw)
In-Reply-To: <20170427164032.GA1578@gmail.com>

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

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

diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c
index ca85476..8a1ebe6 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,10 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
 			continue;
 		}
 
-		index = simple_strtoul(cp, &temp, 10);
+		temp = cp;
+		err = kstrtoul(temp, 10, &index);
+		if (err)
+			return err;
 		if (index > 255) {
 			rejected++;
 			cp = linefeed + 1;
-- 
2.7.4


  parent reply	other threads:[~2017-04-28  3:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170428035012.GA1319@gmail.com \
    --to=cs14btech11006@iith.ac.in \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.