ABout container_of macro

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

 



Hi

May be a silly doubt 

in includ/linux/kernel.h
the following definition of container_of() macro :


#define container_of(ptr, type, member)  \
({const typeof( ((type *)0)->member ) *__mptr = (ptr);
  \
 (type *)( (char *)__mptr - offsetof(type,member) );})


won't it be enough to have
(type *)( (char *) ptr - offsetof(type,member) );}) ??

kanji


		
__________________________________ 
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux