Re: [PATCH] PXA27x UDC driver.

Rodolfo Giometti <[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.linux.kernel,gmane.linux.ports.arm.kernel
Organization GNU/Linux Device Drivers, Embedded Systems and Courses
Message-ID <[email protected]>
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:    [email protected]
Linux Device Driver                             [email protected]
Embedded Systems                     		[email protected]
UNIX programming                     phone:     +39 349 2432127

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.