aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/include/array_size.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2024-07-30 09:30:11 -1000
committerTejun Heo <tj@kernel.org>2024-07-30 09:30:11 -1000
commitc8faf11cd192214e231626c3ee973a35d8fc33f2 (patch)
tree4c3fcfddf4c7c311e1856dbf4dac1240564731f1 /scripts/include/array_size.h
parentsched_ext: Fixes incorrect type in bpf_scx_init() (diff)
parentLinux 6.11-rc1 (diff)
downloadwireguard-linux-c8faf11cd192214e231626c3ee973a35d8fc33f2.tar.xz
wireguard-linux-c8faf11cd192214e231626c3ee973a35d8fc33f2.zip
Merge tag 'v6.11-rc1' into for-6.12
Linux 6.11-rc1
Diffstat (limited to 'scripts/include/array_size.h')
-rw-r--r--scripts/include/array_size.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/include/array_size.h b/scripts/include/array_size.h
new file mode 100644
index 000000000000..26ba78d867d1
--- /dev/null
+++ b/scripts/include/array_size.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef ARRAY_SIZE_H
+#define ARRAY_SIZE_H
+
+/**
+ * ARRAY_SIZE - get the number of elements in array @arr
+ * @arr: array to be sized
+ */
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
+#endif /* ARRAY_SIZE_H */