mtd/include/linux/mtd compatmac.h,1.57,1.58
David Woodhouse
dwmw2 at infradead.org
Fri Oct 3 19:01:01 EDT 2003
Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv10321
Modified Files:
compatmac.h
Log Message:
Add container_of()
Index: compatmac.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/compatmac.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- compatmac.h 2 Jul 2003 10:45:20 -0000 1.57
+++ compatmac.h 3 Oct 2003 23:00:58 -0000 1.58
@@ -122,4 +122,10 @@
#endif /* 2.5.70 */
+#ifndef container_of
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+#endif
+
#endif /* __LINUX_MTD_COMPATMAC_H__ */
More information about the linux-mtd-cvs
mailing list