summaryrefslogtreecommitdiff
path: root/scripts/kconfig/array_size.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2024-04-03 09:13:09 +0200
committerIngo Molnar <mingo@kernel.org>2024-04-03 09:13:09 +0200
commit9b4e528557944dff694c8afa5a8912de81503bf2 (patch)
tree7d4ff38fbf55e1d32e3384cac0ae2fc80d4ae179 /scripts/kconfig/array_size.h
parentdfbc411e0a5ea72fdd563b2c7d627e9d993d865c (diff)
parent39cd87c4eb2b893354f3b850f916353f2658ae6f (diff)
Merge tag 'v6.9-rc2' into perf/core, to pick up dependent commits
Pick up fixes that followup patches are going to depend on. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'scripts/kconfig/array_size.h')
-rw-r--r--scripts/kconfig/array_size.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/kconfig/array_size.h b/scripts/kconfig/array_size.h
new file mode 100644
index 000000000000..26ba78d867d1
--- /dev/null
+++ b/scripts/kconfig/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 */