[ARM] 3044/1: Fix sparse warnings about incompatible pointer types for register defined in pxa-regs.h

Patch from Ian Campbell

The sparse warning initially surfaced in sound/arm/pxa2xx-ac97.c
because it was using u32 * variables to hold the unsigned long *
register addresses.

I submitted an ALSA patch for this http://thread.gmane.org/gmane.linux.alsa.devel/27804 issue and it was suggested that it might be preferable to change the register
definitions to use u32.

Most other subarches seem to use u32 for their register type, at least
the ones which use a __REG macro (like the PXA) do. Nico indicated in
the thread above that he wouldn't mind this patch.

Changing the type required fixes for opposite warnings in the pxa2xx usb
gadget code but that was the only new warning introduced on defconfig
or lubbock, mainstone and our own PXA255 boards.

Signed-off-by: Ian Campbell <icampbell@arcom.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Ian Campbell 2005-10-28 15:26:42 +01:00 committed by Russell King
parent a0e0adb96e
commit 63a4b52c9d
3 changed files with 7 additions and 7 deletions

View File

@ -422,7 +422,7 @@ static inline void ep0_idle (struct pxa2xx_udc *dev)
} }
static int static int
write_packet(volatile unsigned long *uddr, struct pxa2xx_request *req, unsigned max) write_packet(volatile u32 *uddr, struct pxa2xx_request *req, unsigned max)
{ {
u8 *buf; u8 *buf;
unsigned length, count; unsigned length, count;

View File

@ -69,11 +69,11 @@ struct pxa2xx_ep {
* UDDR = UDC Endpoint Data Register (the fifo) * UDDR = UDC Endpoint Data Register (the fifo)
* DRCM = DMA Request Channel Map * DRCM = DMA Request Channel Map
*/ */
volatile unsigned long *reg_udccs; volatile u32 *reg_udccs;
volatile unsigned long *reg_ubcr; volatile u32 *reg_ubcr;
volatile unsigned long *reg_uddr; volatile u32 *reg_uddr;
#ifdef USE_DMA #ifdef USE_DMA
volatile unsigned long *reg_drcmr; volatile u32 *reg_drcmr;
#define drcmr(n) .reg_drcmr = & DRCMR ## n , #define drcmr(n) .reg_drcmr = & DRCMR ## n ,
#else #else
#define drcmr(n) #define drcmr(n)

View File

@ -44,12 +44,12 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
# define __REG(x) (*((volatile unsigned long *)io_p2v(x))) # define __REG(x) (*((volatile u32 *)io_p2v(x)))
/* With indexed regs we don't want to feed the index through io_p2v() /* With indexed regs we don't want to feed the index through io_p2v()
especially if it is a variable, otherwise horrible code will result. */ especially if it is a variable, otherwise horrible code will result. */
# define __REG2(x,y) \ # define __REG2(x,y) \
(*(volatile unsigned long *)((unsigned long)&__REG(x) + (y))) (*(volatile u32 *)((u32)&__REG(x) + (y)))
# define __PREG(x) (io_v2p((u32)&(x))) # define __PREG(x) (io_v2p((u32)&(x)))