netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: LABBE Corentin <clabbe.montjoie@gmail.com>
To: "Charles (Chas) Williams" <3chas3@gmail.com>
Cc: linux-atm-general@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v3 1/1] atm: solos-pci: Replace simple_strtol by kstrtoint
Date: Thu, 3 Dec 2015 13:58:40 +0100	[thread overview]
Message-ID: <20151203125840.GA30012@Red> (raw)
In-Reply-To: <1449141991.2645.67.camel@gmail.com>

On Thu, Dec 03, 2015 at 06:26:31AM -0500, Charles (Chas) Williams wrote:
> On Thu, 2015-12-03 at 09:06 +0100, LABBE Corentin wrote:
> > @@ -357,11 +357,11 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
> >  	if (!str)
> >  		return -EIO;
> >  
> > -	ver = simple_strtol(str, NULL, 10);
> > -	if (ver < 1) {
> > +	err = kstrtoint(str, 10, &ver);
> > +	if (err || ver < 1) {
> >  		dev_warn(&card->dev->dev, "Unexpected status interrupt version %d\n",
> >  			 ver);
> > -		return -EIO;
> > +		return err;
> 
> 
> If ver < 1 then you might return a 0 here.  Always returning -EIO is
> probably just fine.
> 

Hello

I think the best solution is to split the test, since returning error code from kstrtoint was asked by David Miller.
if (err)
	return err;
if (ver < 1)
	return -EIO;
Thanks
Regards

  reply	other threads:[~2015-12-03 12:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03  8:06 [PATCH v3 0/1] atm: solos-pci: Replace simple_strtol by kstrtoint LABBE Corentin
2015-12-03  8:06 ` [PATCH v3 1/1] " LABBE Corentin
2015-12-03 11:26   ` Charles (Chas) Williams
2015-12-03 12:58     ` LABBE Corentin [this message]
2015-12-03 16:34       ` Charles (Chas) Williams

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=20151203125840.GA30012@Red \
    --to=clabbe.montjoie@gmail.com \
    --cc=3chas3@gmail.com \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).