From: Josh Triplett <josh@freedesktop.org>
To: paulmck@linux.vnet.ibm.com
Cc: Stephen Hemminger <shemminger@vyatta.com>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH] net: add sparse annotation to ptype_seq_start/stop
Date: Sun, 20 Jan 2008 23:29:32 -0800 [thread overview]
Message-ID: <479449DC.4020105@freedesktop.org> (raw)
In-Reply-To: <20080121050355.GD7541@linux.vnet.ibm.com> (sfid-20080120_230505_499288_FFFFFFFFEE31D810)
[-- Attachment #1: Type: text/plain, Size: 1465 bytes --]
Paul E. McKenney wrote:
> On Sun, Jan 20, 2008 at 03:21:46PM -0800, Stephen Hemminger wrote:
>> Get rid of some more sparse warnings.
>>
>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> Adding Josh to CC -- is __acquires() case-insensitive? If not, this
> needs to be __acquires(RCU) and __releases(RCU).
[...]
>> --- a/net/core/dev.c 2008-01-20 14:25:00.000000000 -0800
>> +++ b/net/core/dev.c 2008-01-20 14:25:48.000000000 -0800
>> @@ -2543,6 +2543,7 @@ static void *ptype_get_idx(loff_t pos)
>> }
>>
>> static void *ptype_seq_start(struct seq_file *seq, loff_t *pos)
>> + __acquires(rcu)
>> {
>> rcu_read_lock();
>> return *pos ? ptype_get_idx(*pos - 1) : SEQ_START_TOKEN;
>> @@ -2578,6 +2579,7 @@ found:
>> }
>>
>> static void ptype_seq_stop(struct seq_file *seq, void *v)
>> + __releases(rcu)
>> {
>> rcu_read_unlock();
>> }
At the moment, Sparse doesn't actually use the context expression. In
the ideal case when it does, all references to the same lock should
use a context expression which resolves to that lock (whatever that
may mean; hence why Sparse doesn't handle it yet). For mechanisms
like RCU without a lock variable, this will likely entail some sort of
fake lock expression, which again needs to match between all users of
the same mechanism. Like any expression in C, case matters; thus,
please match the existing references to "RCU" rather than "rcu".
- Josh Triplett
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2008-01-21 7:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-20 23:21 [PATCH] net: add sparse annotation to ptype_seq_start/stop Stephen Hemminger
2008-01-21 5:03 ` Paul E. McKenney
2008-01-21 5:28 ` Al Viro
2008-01-21 6:01 ` Paul E. McKenney
2008-01-21 7:29 ` Josh Triplett [this message]
2008-01-21 10:28 ` David Miller
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=479449DC.4020105@freedesktop.org \
--to=josh@freedesktop.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=shemminger@vyatta.com \
/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).