mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
tools: ynl: create local ARRAY_SIZE() helper
libc doesn't have an ARRAY_SIZE() create one locally. Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Link: https://lore.kernel.org/r/20240227223032.1835527-6-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -27,6 +27,9 @@ enum ynl_policy_type {
|
||||
YNL_PT_BITFIELD32,
|
||||
};
|
||||
|
||||
#define YNL_ARRAY_SIZE(array) (sizeof(array) ? \
|
||||
sizeof(array) / sizeof(array[0]) : 0)
|
||||
|
||||
struct ynl_policy_attr {
|
||||
enum ynl_policy_type type;
|
||||
unsigned int len;
|
||||
|
||||
Reference in New Issue
Block a user