As tools/include/linux/kernel.h has it now, with the goodies present in the kernel.h counterpart, i.e. checking that the parameter is an array at build time.
Showing the changes to tools/include/linux (1 of 1 file). Show all
Unified · Split
| @@ -13,10 +13,6 @@ · 12 unmodified lines | |||
| 13 | #include <linux/hash.h> | 13 | #include <linux/hash.h> |
| 14 | #include <linux/log2.h> | 14 | #include <linux/log2.h> |
| 15 | 15 | ||
| 16 | #ifndef ARRAY_SIZE | ||
| 17 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #define DEFINE_HASHTABLE(name, bits) \ | 16 | #define DEFINE_HASHTABLE(name, bits) \ |
| 21 | struct hlist_head name[1 << (bits)] = \ | 17 | struct hlist_head name[1 << (bits)] = \ |
| 22 | { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT } | 18 | { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT } |