linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sparse context warning problem ...
@ 2008-05-11  0:24 David Brownell
  2008-05-11  0:40 ` Johannes Berg
  0 siblings, 1 reply; 10+ messages in thread
From: David Brownell @ 2008-05-11  0:24 UTC (permalink / raw)
  To: linux-sparse

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-05-29  9:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-11  0:24 sparse context warning problem David Brownell
2008-05-11  0:40 ` 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

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).