linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jic23@cam.ac.uk (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: Query about pxa27x_udc.c
Date: Fri, 04 Dec 2009 13:08:15 +0000	[thread overview]
Message-ID: <4B1909BF.9050704@cam.ac.uk> (raw)

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

             reply	other threads:[~2009-12-04 13:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04 13:08 Jonathan Cameron [this message]
2009-12-04 16:56 ` Query about pxa27x_udc.c Robert Jarzmik

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=4B1909BF.9050704@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=linux-arm-kernel@lists.infradead.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 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).