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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Feb 2023 06:59:01 +0000 (07:59 +0100)
commitc9e52db90031b7a89bf667057df5ca9c25cd68ff
treec9026a6af18a8b1ae9c7d27dcdf4a0245e33dbc5
parentc1aa0dd52db4ce888be0bd820c3fa918d350ca0b
tools: fix ARRAY_SIZE defines in tools and selftests hdrs

commit 066b34aa5461f6072dbbecb690f4fe446b736ebf upstream.

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>
Cc: Kyle Huey <me@kylehuey.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/include/linux/kernel.h
tools/testing/selftests/kselftest.h
tools/testing/selftests/kselftest_harness.h