[PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap

David Laight David.Laight at ACULAB.COM
Thu Nov 3 22:14:14 EST 2011


 
> Below are codes for accessing usb sysif_regs in driver:
> 
> usb_sys_regs = (struct usb_sys_interface *)
> 	((u32)dr_regs + USB_DR_SYS_OFFSET);
> 
> these codes work in 32-bit, but in 64-bit, use u32 to type cast the
address
> of ioremap is not right, and accessing members of 'usb_sys_regs' will
cause
> call trace, so use unsigned long for both 32-bit and 64-bit.

Wouldn't a (char *) cast be even better?

	David




More information about the Linuxppc-dev mailing list