kselftest/kselftest_harness.h: do not redefine ARRAY_SIZE
Subsystems (2)
PATCH 1/1 kselftest/kselftest_harness.h: do not redefine ARRAY_SIZE
Macro ARRAY_SIZE is defined in tools/include/linux/kernel.h, so if both headers are included there is a warning.
Signed-off-by Peter Oskolkov <[email protected]>
--- tools/testing/selftests/kselftest_harness.h | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/kselftest_harness.h +2 -0
@@ -671,7 +671,9 @@#define EXPECT_STRNE (expected, seen) \ __EXPECT_STR(expected, seen, !=, 0) +#ifndef ARRAY_SIZE #define ARRAY_SIZE (a) (sizeof(a) / sizeof(a[0])) +#endif /* Support an optional handler after and ASSERT_* or EXPECT_*. The approach is * not thread-safe, but it should be fine in most sane test scenarios.
Signature · 1 line
2.32.0.93.g670b81a890-goog
Shuah Khan
maintainerQuoted 14 lines · Peter Oskolkov
Macro
ARRAY_SIZEis defined intools/include/linux/kernel.h, so if both headers are included there is a warning.Signed-off-by Peter Oskolkov <[email protected]>--- tools/testing/selftests/kselftest_harness.h | 2 ++ 1 file changed, 2 insertions(+)tools/testing/selftests/kselftest_harness.h +0
-0
tools/testing/selftests/kselftest_harness.h line 679
Quoted 9 lines
tools/testing/selftests/kselftest_harness.h +2
-0@@ -671,7 +671,9 @@#define EXPECT_STRNE (expected, seen) \ __EXPECT_STR(expected, seen, !=, 0) +#ifndef ARRAY_SIZE #define ARRAY_SIZE (a) (sizeof(a) / sizeof(a[0])) +#endif /* Support an optional handler after and ASSERT_* or EXPECT_*. The approach is * not thread-safe, but it should be fine in most sane test scenarios.
Thank you for the patch. This will be queued for rc2 after the merge window closes.
thanks,
-- Shuah