From df3cb7ac0edcc9c850799ae1c7a9cb33e95f834d Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Tue, 18 Jul 2023 07:27:46 +0200 Subject: kunit: test-bug.h: include `stddef.h` for `NULL` The header uses `NULL` in both `CONFIG_KUNIT=y` and `=n` cases, but does not include it explicitly. When `CONFIG_KUNIT=y`, the header is already getting included via the other headers, so it is not a problem for users. However, when `CONFIG_KUNIT=n`, it is not, and thus a user could hit a build error when including `kunit/test-bug.h`, like we are doing later in this series [1]. Thus include `linux/stddef.h`, and do so outside the `#if`, since it is used in both cases. Reported-by: Boqun Feng Closes: https://lore.kernel.org/rust-for-linux/ZJ8cNUW3oR2p+gL1@boqun-archlinux/ [1] Signed-off-by: Miguel Ojeda Reviewed-by: David Gow Signed-off-by: Shuah Khan --- include/kunit/test-bug.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/kunit') diff --git a/include/kunit/test-bug.h b/include/kunit/test-bug.h index 30ca541b6ff2..47aa8f21ccce 100644 --- a/include/kunit/test-bug.h +++ b/include/kunit/test-bug.h @@ -9,6 +9,8 @@ #ifndef _KUNIT_TEST_BUG_H #define _KUNIT_TEST_BUG_H +#include /* for NULL */ + #if IS_ENABLED(CONFIG_KUNIT) #include /* For static branch */ -- cgit