public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: samuel kihahu <skihahu@gmail.com>
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	speakup@linux-speakup.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: speakup: replace simple_strtoul with kstrtoul
Date: Fri, 19 Dec 2014 00:25:02 +0300	[thread overview]
Message-ID: <20141218212502.GP4856@mwanda> (raw)
In-Reply-To: <20141218144810.GA16115@localhost.localdomain>

On Thu, Dec 18, 2014 at 05:48:10PM +0300, samuel kihahu wrote:
> On Wed, Dec 17, 2014 at 05:03:22PM +0300, Dan Carpenter wrote:
> > On Wed, Dec 17, 2014 at 04:43:54PM +0300, samuel kihahu wrote:
> > > 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.
> > 
> > You have to compile test these things.  Really kernel programming is not
> > a good way to learn how to program.  :(
> > 
> > regards,
> > dan carpenter
> > 
> 
> Appreciate the feedback, have modified the patch, tested and confirmed
> it builds.

No.  It's still really wrong.  One of the key differences between
kstrtoul() and simple_strtoul() is that simple_strtoul() gives you a
pointer to the end of the string.

It's actually best to use simple_strtoul() here.  Checkpatch.pl is
wrong.

As well the new error handling doesn't work at all.

regards,
dan carpenter


  reply	other threads:[~2014-12-18 21:25 UTC|newest]

Thread overview: 9+ 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
2014-12-17 14:03     ` Dan Carpenter
2014-12-18 14:48       ` samuel kihahu
2014-12-18 21:25         ` Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-02-23 19:31 [PATCH] staging: speakup: Replace " 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=20141218212502.GP4856@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skihahu@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox