summaryrefslogtreecommitdiff
path: root/scripts/include/array_size.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2024-08-02 15:10:55 +0300
committerThomas Gleixner <tglx@linutronix.de>2024-08-02 15:10:55 +0300
commit4436e6da008fee87d54c038e983e5be9a6baf8fb (patch)
tree265a15efcf6f17e0e32e258d66b274fc5cad41d4 /scripts/include/array_size.h
parentb7c35279e0da414e7d90eba76f58a16223a734cb (diff)
parent8400291e289ee6b2bf9779ff1c83a291501f017b (diff)
downloadlinux-4436e6da008fee87d54c038e983e5be9a6baf8fb.tar.xz
Merge branch 'linus' into x86/mm
Bring x86 and selftests up to date
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 */