Use gcc void* arithmetic to avoid cast warning

This commit is contained in:
Nils O. Selåsdal
2012-12-18 20:06:40 +01:00
parent 690b6ba18a
commit 0782e2f825
+1 -1
View File
@@ -47,7 +47,7 @@
//struct foo *f = CONTAINER_OF(p, struct foo, zap);
#define CONTAINER_OF(ptr, type, member) ({ \
typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type, member) ); })
(type *)( (void *)__mptr - offsetof(type, member) ); })
#define UC_ALIGN(val,align) (((val)+(align)-1UL)&~((align)-1UL))