> >> > 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. Arithmetic on 'void *' should not be done. I know some versions of gcc allow it (provided some warning level/option is enabled) but that doesn't mean it is valid. My suspicions are that is was allowed due to the way 'void *' was originally bodged into gcc. > A char* is incorrect because a char could be more > than one byte, in theory. It is somewhat difficult to untangle the standard, but sizeof (char) is defined to be one. Of course, the C language doesn't actually require that you can converts between pointers to different types in any well-defined manner. But most of the low level device access assumes an adequately linear address space. David -- 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