tools: fix ARRAY_SIZE defines in tools and selftests hdrs
authorShuah Khan <skhan@linuxfoundation.org>
Wed, 8 Dec 2021 17:47:42 +0000 (10:47 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Sat, 11 Dec 2021 00:50:17 +0000 (17:50 -0700)
commit066b34aa5461f6072dbbecb690f4fe446b736ebf
tree17eb5e4f0c9a0058804ec152fb0b9d360da1df4f
parenta738a4ce8421b2187fa5b74bb475eeeb6ec9ac14
tools: fix ARRAY_SIZE defines in tools and selftests hdrs

tools/include/linux/kernel.h and kselftest_harness.h are missing
ifndef guard around ARRAY_SIZE define. Fix them to avoid duplicate
define errors during compile when another file defines it. This
problem was found when compiling selftests that include a header
with ARRAY_SIZE define.

ARRAY_SIZE is defined in several selftests. There are about 25+
duplicate defines in various selftests source and header files.
Add ARRAY_SIZE to kselftest.h in preparation for removing duplicate
ARRAY_SIZE defines from individual test files.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/include/linux/kernel.h
tools/testing/selftests/kselftest.h
tools/testing/selftests/kselftest_harness.h