* Query about pxa27x_udc.c
@ 2009-12-04 13:08 Jonathan Cameron
2009-12-04 16:56 ` Robert Jarzmik
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Cameron @ 2009-12-04 13:08 UTC (permalink / raw)
To: linux-arm-kernel
Just had the following pop up in a compile of linux-next
drivers/usb/gadget/pxa27x_udc.c: In function 'pxa_udc_irq':
drivers/usb/gadget/pxa27x_udc.c:2232: warning: array subscript is above array bounds
drivers/usb/gadget/pxa27x_udc.c:2232: warning: array subscript is above array bounds
drivers/usb/gadget/pxa27x_udc.c:2233: warning: array subscript is above array bounds
I'm not sure what the lines in question are actually doing (and at least
at first glance they can never access anything in the array).
for (i = 16; udcisr1 != 0 && i < 24; udcisr1 >>= 2, i++) {
udc_writel(udc, UDCISR1, UDCISR_INT(i - 16, UDCISR_INT_MASK));
if (!(udcisr1 & UDCISR_INT_MASK))
continue;
ep = &udc->pxa_ep[i];
ep->stats.irqs++;
handle_ep(ep);
}
Where the warning is about the call to &udc->pxa_ep[i]
Seeing as that appears to only ever contain 15 elements this doesn't look good.
I haven't waded through everything that happens to this structure so I guess it might
be doing something less than obvious.
Jonathan
^ permalink raw reply [flat|nested] 2+ messages in thread* Query about pxa27x_udc.c
2009-12-04 13:08 Query about pxa27x_udc.c Jonathan Cameron
@ 2009-12-04 16:56 ` Robert Jarzmik
0 siblings, 0 replies; 2+ messages in thread
From: Robert Jarzmik @ 2009-12-04 16:56 UTC (permalink / raw)
To: linux-arm-kernel
Jonathan Cameron <jic23@cam.ac.uk> writes:
> Just had the following pop up in a compile of linux-next
>
>
> drivers/usb/gadget/pxa27x_udc.c: In function 'pxa_udc_irq':
> drivers/usb/gadget/pxa27x_udc.c:2232: warning: array subscript is above array bounds
> drivers/usb/gadget/pxa27x_udc.c:2232: warning: array subscript is above array bounds
> drivers/usb/gadget/pxa27x_udc.c:2233: warning: array subscript is above array bounds
Yes, recent gcc complains.
There is a patch from Enrico Scholz, I resent it in another mail.
Cheers.
--
Robert
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-04 16:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-04 13:08 Query about pxa27x_udc.c Jonathan Cameron
2009-12-04 16:56 ` Robert Jarzmik
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).