From: samuel kihahu <skihahu@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
speakup@linux-speakup.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: speakup: replace simple_strtoul with kstrtoul
Date: Wed, 17 Dec 2014 16:43:54 +0300 [thread overview]
Message-ID: <20141217134354.GA585@localhost.localdomain> (raw)
In-Reply-To: <20141217121119.GL4856@mwanda>
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
On Wed, Dec 17, 2014 at 03:11:19PM +0300, Dan Carpenter wrote:
> On Wed, Dec 17, 2014 at 02:56:02PM +0300, samuel kihahu wrote:
> > Replacing obsolete simple_strtoul with kstrtoul.
> >
>
> Nope. That's wrong. Learn how the functions are different beyond just
> the name.
Noted, have made corrections to fit the kstrtoul and handle the return
value.
[-- Attachment #2: 0001-staging-speakup-replace-simple_strtoul-with-kstrtoul.patch --]
[-- Type: text/plain, Size: 992 bytes --]
>From 71d2f7123e697b95371585b4af9a0b35262307ea Mon Sep 17 00:00:00 2001
From: samuel kihahu <skihahu@gmail.com>
Date: Wed, 17 Dec 2014 16:31:05 +0300
Subject: [PATCH] staging: speakup: replace simple_strtoul with kstrtoul
Replacing obsolete simple_strtoul with kstrtoul and checking the
return status.
Signed-off-by: samuel kihahu <skihahu@gmail.com>
---
drivers/staging/speakup/varhandlers.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c
index d758284..8ac9ad7 100644
--- a/drivers/staging/speakup/varhandlers.c
+++ b/drivers/staging/speakup/varhandlers.c
@@ -321,9 +321,10 @@ char *spk_strlwr(char *s)
char *spk_s2uchar(char *start, char *dest)
{
- int val = 0;
+ unsigned long val;
- val = simple_strtoul(skip_spaces(start), &start, 10);
+ if (kstrtoul(skip_spaces(start), &start, val))
+ return -EINVAL;
if (*start == ',')
start++;
*dest = (u_char)val;
--
1.8.3.1
next prev parent reply other threads:[~2014-12-17 13:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 11:56 [PATCH] staging: speakup: replace simple_strtoul with kstrtoul samuel kihahu
2014-12-17 12:11 ` Dan Carpenter
2014-12-17 13:43 ` samuel kihahu [this message]
2014-12-17 14:03 ` Dan Carpenter
2014-12-18 14:48 ` samuel kihahu
2014-12-18 21:25 ` Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2016-02-22 12:18 [PATCH] staging: speakup: Replace " Amitoj Kaur Chawla
2016-10-11 6:18 [PATCH] Staging: " Mihaela Muraru
2016-10-11 6:47 ` Greg Kroah-Hartman
2016-10-11 7:29 ` Muraru Mihaela
2016-10-11 19:49 ` Muraru Mihaela
2018-03-08 19:27 [PATCH] staging: " Nishka Dasgupta
2018-03-08 19:21 ` Nishka Dasgupta
2018-03-08 19:34 ` Samuel Thibault
2018-03-08 19:43 Nishka Dasgupta
2018-03-08 19:45 ` Samuel Thibault
2018-03-08 19:49 Nishka Dasgupta
2018-03-08 19:53 ` Samuel Thibault
2019-02-23 19:31 Bharath Vedartham
2019-02-23 19:37 ` Samuel Thibault
2019-02-23 20:02 ` Bharath Vedartham
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=20141217134354.GA585@localhost.localdomain \
--to=skihahu@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=speakup@linux-speakup.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.