lkml.org 
[lkml]   [2007]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PXA27x UDC driver.
On Thu, Jun 28, 2007 at 02:29:49PM -0700, Andrew Morton wrote:
> >
> > +
> > +static int
> > +write_packet(volatile u32 * uddr, struct pxa27x_request *req, unsigned max)
>
> Please review Documentation/volatile-considered-harmful.txt

The attibute volatile here is necessary in order to avoid getting the
following warnings from the compiler:

CC drivers/usb/gadget/pxa27x_udc.o
drivers/usb/gadget/pxa27x_udc.c: In function `write_ep0_fifo':
drivers/usb/gadget/pxa27x_udc.c:512: warning: passing arg 1 of `write_packet' discards qualifiers from pointer target type
drivers/usb/gadget/pxa27x_udc.c: In function `pxa27x_ep_alloc':
drivers/usb/gadget/pxa27x_udc.c:1206: warning: assignment discards qualifiers from pointer target type
drivers/usb/gadget/pxa27x_udc.c:1207: warning: assignment discards qualifiers from pointer target type
drivers/usb/gadget/pxa27x_udc.c:1208: warning: assignment discards qualifiers from pointer target type
drivers/usb/gadget/pxa27x_udc.c:1209: warning: assignment discards qualifiers from pointer target type
drivers/usb/gadget/pxa27x_udc.c: At top level:
drivers/usb/gadget/pxa27x_udc.c:2159: warning: initialization discards qualifiers from pointer target type
drivers/usb/gadget/pxa27x_udc.c:2160: warning: initialization discards qualifiers from pointer target type

This because the variables reg_* are assigned as:

.reg_udccsr = &UDCCSR0

where UDCCSR0 are defined as:

#define UDCCSR0 __REG(0x40600100) /* UDC Control/Status register - Endpoint 0 */

and:

define __REG(x) (*((volatile u32 *)io_p2v(x)))

Do you know how I can resolve this?

Thanks in advance,

Rodolfo

--

GNU/Linux Solutions e-mail: giometti@enneenne.com
Linux Device Driver giometti@gnudd.com
Embedded Systems giometti@linux.it
UNIX programming phone: +39 349 2432127
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-10 17:51    [W:0.129 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site