From: David Brownell <david-b@pacbell.net>
To: linux-sparse@vger.kernel.org
Subject: sparse context warning problem ...
Date: Sat, 10 May 2008 17:24:03 -0700 [thread overview]
Message-ID: <200805101724.04014.david-b@pacbell.net> (raw)
I just noticed this with some obviously correct code... and verified
that it's a regression in current GIT version of "sparse" since it
now rejects code which previously passed just fine.
The issue is a not-uncommon idiom, where a function must be called
with a lock held, and briefly drops it. The way this has previously
been addressed, originally suggested by Linus and used in various
places in the kernel (but, I observe, not in the "sparse" internal
validation test cases) is:
static void
finish_urb(struct ohci_hcd *ohci, struct urb *urb, int status)
__releases(ohci->lock)
__acquires(ohci->lock)
{
...
}
But current versions of "sparse" complain (wrongly):
drivers/usb/host/ohci-q.c:66:2: warning: context imbalance in 'finish_urb': __context__ statement expected different context
drivers/usb/host/ohci-q.c:66:2: context '<noident>': wanted >= 0, got -1
Presumably this is this a known bug ... is a fix on the way?
(Meanwhile, I can just ignore this bogus output.)
- Dave
next reply other threads:[~2008-05-11 0:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-11 0:24 David Brownell [this message]
2008-05-11 0:40 ` sparse context warning problem Johannes Berg
2008-05-11 3:18 ` David Brownell
2008-05-11 9:46 ` Johannes Berg
2008-05-13 21:52 ` Johannes Berg
2008-05-14 13:58 ` David Brownell
2008-05-14 14:06 ` Johannes Berg
2008-05-29 8:47 ` Johannes Berg
2008-05-29 9:39 ` David Brownell
2008-05-29 9:54 ` Johannes Berg
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=200805101724.04014.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=linux-sparse@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.