[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111108193817.GA3453@p183.telecom.by>
Date: Tue, 8 Nov 2011 22:38:18 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Julia Lawall <julia@...u.dk>
Cc: "J. Bruce Fields" <bfields@...ldses.org>,
kernel-janitors@...r.kernel.org, Neil Brown <neilb@...e.de>,
Trond Myklebust <Trond.Myklebust@...app.com>,
"David S. Miller" <davem@...emloft.net>, linux-nfs@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] net/sunrpc: use kstrtoul, etc
On Sun, Nov 06, 2011 at 02:26:47PM +0100, Julia Lawall wrote:
> @@
> expression a,b;
> {int,long} *c;
> @@
>
> -strict_strtoul
> +kstrtoul
No, no, no!
In every case see the type or real data and use appropriate function.
kstrtou8() for ports.
This program creates lots of bogus patches in this case.
> --- a/net/sunrpc/addr.c
> +++ b/net/sunrpc/addr.c
> @@ -322,7 +322,7 @@ size_t rpc_uaddr2sockaddr(const char *ua
> c = strrchr(buf, '.');
> if (unlikely(c == NULL))
> return 0;
> - if (unlikely(strict_strtoul(c + 1, 10, &portlo) != 0))
> + if (unlikely(kstrtoul(c + 1, 10, &portlo) != 0))
> return 0;
> if (unlikely(portlo > 255))
> return 0;
> @@ -331,7 +331,7 @@ size_t rpc_uaddr2sockaddr(const char *ua
> c = strrchr(buf, '.');
> if (unlikely(c == NULL))
> return 0;
> - if (unlikely(strict_strtoul(c + 1, 10, &porthi) != 0))
> + if (unlikely(kstrtoul(c + 1, 10, &porthi) != 0))
> return 0;
> if (unlikely(porthi > 255))
> return 0;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists