don't use const in CONTAINER_OF
This commit is contained in:
@@ -46,7 +46,7 @@
|
|||||||
//give us the struct foo*:
|
//give us the struct foo*:
|
||||||
//struct foo *f = CONTAINER_OF(p, struct foo, zap);
|
//struct foo *f = CONTAINER_OF(p, struct foo, zap);
|
||||||
#define CONTAINER_OF(ptr, type, member) ({ \
|
#define CONTAINER_OF(ptr, type, member) ({ \
|
||||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
||||||
(type *)( (char *)__mptr - offsetof(type, member) ); })
|
(type *)( (char *)__mptr - offsetof(type, member) ); })
|
||||||
|
|
||||||
#define UC_ALIGN(val,align) (((val)+(align)-1UL)&~((align)-1UL))
|
#define UC_ALIGN(val,align) (((val)+(align)-1UL)&~((align)-1UL))
|
||||||
|
|||||||
Reference in New Issue
Block a user