From: Julia Lawall <julia.lawall@lip6.fr>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Julia Lawall <julia@diku.dk>,
"J. Bruce Fields" <bfields@fieldses.org>,
kernel-janitors@vger.kernel.org, Neil Brown <neilb@suse.de>,
Trond Myklebust <Trond.Myklebust@netapp.com>,
"David S. Miller" <davem@davemloft.net>,
linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] net/sunrpc: use kstrtoul, etc
Date: Tue, 08 Nov 2011 20:19:30 +0000 [thread overview]
Message-ID: <alpine.DEB.2.02.1111082113380.1880@hadrien> (raw)
In-Reply-To: <20111108193817.GA3453@p183.telecom.by>
On Tue, 8 Nov 2011, Alexey Dobriyan wrote:
> 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!
Sorry, this was not the real rule I used for the strtoul case. Instead I
used the following:
@@
typedef ulong;
expression a,b;
{ulong,unsigned long,unsigned int,size_t} *c;
@@
-strict_strtoul
+kstrtoul
(a,b,c)
But now I have seen that there is a separate function for integers, so I
have made a rule to use that function when the type is unsigned int.
> In every case see the type or real data and use appropriate function.
> kstrtou8() for ports.
The type of the destination variable in all of these cases is unsigned
long. But maybe that is not enough information to make the
transformation in the right way.
julia
> 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 kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2011-11-08 20:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-06 13:26 [PATCH 0/5] use kstrtoul, etc Julia Lawall
2011-11-06 13:26 ` [PATCH 1/5] net/batman-adv: " Julia Lawall
2011-11-06 14:16 ` [B.A.T.M.A.N.] " Marek Lindner
2011-11-06 13:26 ` [PATCH 2/5] net/sunrpc: " Julia Lawall
2011-11-08 19:38 ` Alexey Dobriyan
2011-11-08 20:19 ` Julia Lawall [this message]
2011-11-08 20:45 ` Alexey Dobriyan
2011-11-09 6:15 ` Julia Lawall
2011-11-06 13:26 ` [PATCH 3/5] net/mac80211/debugfs.c: " Julia Lawall
2011-11-07 11:47 ` Eliad Peller
2011-11-07 11:58 ` Julia Lawall
2011-11-06 13:26 ` [PATCH 4/5] net/rfkill/core.c: " Julia Lawall
2011-11-06 13:26 ` [PATCH 5/5] net/dns_resolver/dns_key.c: " Julia Lawall
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=alpine.DEB.2.02.1111082113380.1880@hadrien \
--to=julia.lawall@lip6.fr \
--cc=Trond.Myklebust@netapp.com \
--cc=adobriyan@gmail.com \
--cc=bfields@fieldses.org \
--cc=davem@davemloft.net \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--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