RE: [PATCH] usb/host/ohci-hcd.c: fix sparse warnings

From: H Hartley Sweeten
Date: Wed Apr 22 2009 - 13:40:28 EST


On Tuesday, April 21, 2009 10:53 PM, Greg KH wrote:
> On Wed, Apr 15, 2009 at 10:04:17PM -0400, H Hartley Sweeten wrote:
> Fix sparse warnings in drivers/usb/host/ohci-hcd.c.
>>
>> warning: symbol 'temp' shadows an earlier one
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
>
> I'm not seeing this sparse warning either.
>
> And you didn't fix the two sparse warnings I am seeing in this file,
> so I'm going to think this patch doesn't really do anything :(

Following are the sparse warnings I am seeing when building for an
EP93xx ARM platform:

CHECK drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-hcd.c:626:2: warning: symbol 'temp' shadows an
earlier one
drivers/usb/host/ohci-hcd.c:574:14: originally declared here
drivers/usb/host/ohci-hcd.c:634:4: warning: symbol 'temp' shadows an
earlier one
drivers/usb/host/ohci-hcd.c:574:14: originally declared here
drivers/usb/host/ohci-hcd.c:676:3: warning: symbol 'temp' shadows an
earlier one
drivers/usb/host/ohci-hcd.c:574:14: originally declared here
drivers/usb/host/ohci-hcd.c:724:2: warning: symbol 'temp' shadows an
earlier one
drivers/usb/host/ohci-hcd.c:574:14: originally declared here
drivers/usb/host/ohci-q.c:69:2: warning: context imbalance in
'finish_urb': __context__ statement expected different context
drivers/usb/host/ohci-q.c:69:2: context '<noident>': wanted >= 0, got
-1
drivers/usb/host/ohci-q.c:991:15: warning: context problem in
'finish_unlinks': 'finish_urb' expected different context
drivers/usb/host/ohci-q.c:991:15: context 'lock': wanted >= 1, got 0
drivers/usb/host/ohci-q.c:1082:13: warning: context problem in
'takeback_td': 'finish_urb' expected different context
drivers/usb/host/ohci-q.c:1082:13: context 'lock': wanted >= 1, got 0
drivers/usb/host/ohci-hcd.c:298:14: warning: context problem in
'ohci_urb_dequeue': 'finish_urb' expected different context
drivers/usb/host/ohci-hcd.c:298:14: context 'lock': wanted >= 1, got
0

All the 'temp' shadows warnings appear to be caused by the
raw_local_irq_disable() macro in arch/arm/include/asm/irqflags.h.

I have no idea how to fix the context imbalance warnings so I left
those alone. The functions seem to be tagged correctly with __releases()
and __acquires() as needed. Could those be a problem with sparse?

> thanks,
>
> greg k-h

Regards,
Hartley
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/