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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Laight wrote:
>> >  usb_sys_regs = (void *)dr_regs + USB_DR_SYS_OFFSET;

> But that is invalid C.

What's invalid about it?  I haven't tried compiling this specific line of 
code, but I've done stuff like it in the past many times.

Are you talking about adding an integer to a void pointer?  If so, then 
that's something that gcc supports and that the kernel uses all over the 
place.  A char* is incorrect because a char could be more than one byte, 
in theory.

-- 
Timur Tabi
Linux kernel developer at Freescale
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux