* sparse 0.2 - incomprehensible context warnings
@ 2006-12-05 22:07 Ulrich Kunitz
2007-01-31 23:06 ` Christopher Li
0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Kunitz @ 2006-12-05 22:07 UTC (permalink / raw)
To: linux-sparse
Hi,
I have tried sparse 0.2 for the zd1211rw WLAN driver, which I
happen to contribute too.
I get numerous context imbalance warnings, that I don't
understand. This is on an SMP (x86-64) build of a vanilla 2.6.19.
I get the same warning on an SMP build of PPC32.
A simple example is:
/home/kunitz/zd1211/rw/zd_usb.c:1167:13: warning: context imbalance in 'disable_read_regs_int' - wrong count at exit
zd_usb.c
1167 static void disable_read_regs_int(struct zd_usb *usb)
1168 {
1169 struct zd_usb_interrupt *intr = &usb->intr;
1170
1171 spin_lock_irq(&intr->lock);
1172 intr->read_regs_enabled = 0;
1173 spin_unlock_irq(&intr->lock);
1174 }
Please set me on CC of the answer I'm not a regular reader of this
list.
You will find the driver source in the kernel itself. I tested it
however against my latest git tree, which is available from
git-clone http://deine-taler.de/zd1211/zd1211.git
--
Uli Kunitz
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: sparse 0.2 - incomprehensible context warnings
2006-12-05 22:07 sparse 0.2 - incomprehensible context warnings Ulrich Kunitz
@ 2007-01-31 23:06 ` Christopher Li
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Li @ 2007-01-31 23:06 UTC (permalink / raw)
To: Ulrich Kunitz; +Cc: linux-sparse
It has been a while. I find out why during this happen during
I debugging my other interrupt checker.
_spin_unlock_irq() is a macro which will expand to __raw_spin_unlock(),
which inline into a function. But _spin_lock_irq is an external function
which does not inline.
So sparse only sees the unlock, it can't see the locking.
Chris
On Tue, Dec 05, 2006 at 11:07:10PM +0100, Ulrich Kunitz wrote:
> Hi,
>
> I have tried sparse 0.2 for the zd1211rw WLAN driver, which I
> happen to contribute too.
>
> I get numerous context imbalance warnings, that I don't
> understand. This is on an SMP (x86-64) build of a vanilla 2.6.19.
> I get the same warning on an SMP build of PPC32.
>
> A simple example is:
>
> /home/kunitz/zd1211/rw/zd_usb.c:1167:13: warning: context imbalance in 'disable_read_regs_int' - wrong count at exit
>
> zd_usb.c
> 1167 static void disable_read_regs_int(struct zd_usb *usb)
> 1168 {
> 1169 struct zd_usb_interrupt *intr = &usb->intr;
> 1170
> 1171 spin_lock_irq(&intr->lock);
> 1172 intr->read_regs_enabled = 0;
> 1173 spin_unlock_irq(&intr->lock);
> 1174 }
>
> Please set me on CC of the answer I'm not a regular reader of this
> list.
>
> You will find the driver source in the kernel itself. I tested it
> however against my latest git tree, which is available from
>
> git-clone http://deine-taler.de/zd1211/zd1211.git
>
> --
> Uli Kunitz
> -
> To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-01-31 23:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-05 22:07 sparse 0.2 - incomprehensible context warnings Ulrich Kunitz
2007-01-31 23:06 ` Christopher Li
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).