On pointer type and the return type of ioremap

Grissiom chaos.proton at gmail.com
Wed Jul 24 10:48:08 EDT 2013


Hi all,

I'm writing my little module now a days and want to ioremap some space. I
learnt from LDD3 that "Therefore, generic memory addresses in the kernel
are usually unsigned long"(ch11). So I declared a pointer like "usigned
long p2dev;" But when I feed it with ioremap, it yields a warning:

warning: assignment makes integer from pointer without a cast [enabled by
default]

Do I really have to add a cast? What is the reason that while "generic
pointers are unsigned long" but the return type of ioremap is void *?

Thanks in advance.

-- 
Cheers,
Grissiom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130724/2f0efb2b/attachment.html 


More information about the Kernelnewbies mailing list