In linux, container_of
macro is enclosed in seemingly "extra" parentheses:
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr);
(type *)( (char *)__mptr - offsetof(type,member) );})
Instead of it, can we just use
#define container_of(ptr, type, member) { \
const typeof( ((type *)0)->member ) *__mptr = (ptr);
(type *)( (char *)__mptr - offsetof(type,member) );}
?
Are the parentheses mandatory or are they just for precaution?