diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2024-08-02 15:10:55 +0300 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2024-08-02 15:10:55 +0300 |
| commit | 4436e6da008fee87d54c038e983e5be9a6baf8fb (patch) | |
| tree | 265a15efcf6f17e0e32e258d66b274fc5cad41d4 /scripts/include/array_size.h | |
| parent | b7c35279e0da414e7d90eba76f58a16223a734cb (diff) | |
| parent | 8400291e289ee6b2bf9779ff1c83a291501f017b (diff) | |
| download | linux-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.h | 11 |
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 */ |
