Move container_of and ARRAY_SIZE to sys/sysmacros.h
The code can be taken from FreeBSD:
#define container_of(p, stype, field) \
((stype *)(((uint8_t *)(p)) - offsetof(stype, field)))
If you wonder what it is, here's an explanation of the Linux container_of macro, which is similar: http://www.kroah.com/log/linux/container_of.html
Updated by Rich Lowe almost 10 years ago
There's an implementation in the IB code, here: usr/src/uts/common/sys/ib/clients/rdsv3/rdsv3_impl.h#123
You could take this one, or add one, but when you do please clean this one up.
I don't want a repeat of offsetof's miriad definitions.