netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: LABBE Corentin <clabbe.montjoie@gmail.com>,
	3chas3@gmail.com, linux-atm-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 1/1] atm: solos-pci: Replace simple_strtol by kstrtoint
Date: Wed, 2 Dec 2015 17:02:19 +0300	[thread overview]
Message-ID: <565EF9EB.3000509@cogentembedded.com> (raw)
In-Reply-To: <1449060889-20447-2-git-send-email-clabbe.montjoie@gmail.com>

Hello.

On 12/2/2015 3:54 PM, LABBE Corentin wrote:

> The simple_strtol function is obsolete.
> This patch replace it by kstrtoint.
> This will simplify code, since some error case not handled by
> simple_strtol are handled by kstrtoint.
>
> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
> ---
>   drivers/atm/solos-pci.c | 28 +++++++++++++++-------------
>   1 file changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
> index 3d7fb65..f944d75 100644
> --- a/drivers/atm/solos-pci.c
> +++ b/drivers/atm/solos-pci.c
> @@ -347,8 +347,8 @@ static char *next_string(struct sk_buff *skb)
>    */
>   static int process_status(struct solos_card *card, int port, struct sk_buff *skb)
>   {
> -	char *str, *end, *state_str, *snr, *attn;
> -	int ver, rate_up, rate_down;
> +	char *str, *state_str, *snr, *attn;
> +	int ver, rate_up, rate_down, err;
>
>   	if (!card->atmdev[port])
>   		return -ENODEV;
> @@ -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 (ver < 1 || err) {

    Is 'ver' initialized in case of error? If not, you have to check 'err' first.

[...]

MBR, Sergei

  reply	other threads:[~2015-12-02 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-02 12:54 [PATCH v2 0/1] atm: solos-pci: Replace simple_strtol by kstrtoint LABBE Corentin
2015-12-02 12:54 ` [PATCH v2 1/1] " LABBE Corentin
2015-12-02 14:02   ` Sergei Shtylyov [this message]
2015-12-03  7:52     ` LABBE Corentin
2015-12-03 11:41       ` Sergei Shtylyov

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=565EF9EB.3000509@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=3chas3@gmail.com \
    --cc=clabbe.montjoie@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).