linux/scripts/kconfig/array_size.h
Masahiro Yamada a6dac4002b kconfig: move ARRAY_SIZE to a header
To use ARRAY_SIZE from other files, move it to its own header,
just like include/linux/array_size.h.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2024-02-19 18:20:41 +09:00

12 lines
258 B
C

/* 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 */