From: Josh Triplett <josh@freedesktop.org>
To: Christopher Li <sparse@chrisli.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Anton Altaparmakov <aia21@cam.ac.uk>,
linux-sparse@vger.kernel.org
Subject: Re: Another sparse warning...
Date: Tue, 13 Feb 2007 00:49:04 -0800 [thread overview]
Message-ID: <45D17B80.8040905@freedesktop.org> (raw)
In-Reply-To: <20070213042152.GC2922@chrisli.org>
[-- Attachment #1: Type: text/plain, Size: 1471 bytes --]
Christopher Li wrote:
> On Mon, Feb 12, 2007 at 07:48:18PM -0800, Linus Torvalds wrote:
>>> When call one of those functions, it can know that function will change
>>> context. That might be a way to solve the problem that some of the
>>> spinlock function is not a inline function at all.
>> I thought we did that already. I'm fairly sure I had this working at some
>> point - exactly by having the calls just add up the (known) lock/unlock
>> offsets.
>
> You are right. It is already there. I never see it before because my ctags
> get confused about the context annotation:
>
> void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock);
>
> It generate tags for "lock" instead of "_spin_lock".
Interesting behavior. :) That makes sense, given ctags' regex-based parsing.
About that syntax: I chose to use the parameter name there because I wanted to
use arbitrary expressions (like param_struct->lock) for a context, rather than
a parameter number (as used in printf annotations). I'd love to see any
thoughts you might have on how best to parse that expression into something
with "placeholders" for formal parameters, and then easily substitute the
actual parameters at each call site to determine the expression for the
acquired or released context. Then we need a solution for the more difficult
problem: unifying and tracking context expressions in the face of changing
data in those expressions.
- Josh Triplett
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2007-02-13 8:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-12 10:23 Another sparse warning Anton Altaparmakov
2007-02-12 15:50 ` Linus Torvalds
2007-02-12 15:55 ` Anton Altaparmakov
2007-02-13 2:00 ` Christopher Li
2007-02-13 3:48 ` Linus Torvalds
2007-02-13 4:21 ` Christopher Li
2007-02-13 8:49 ` Josh Triplett [this message]
2007-02-13 8:38 ` Josh Triplett
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=45D17B80.8040905@freedesktop.org \
--to=josh@freedesktop.org \
--cc=aia21@cam.ac.uk \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
--cc=torvalds@linux-foundation.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).