[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABVgOSma4wc6u2fU9SmK0N4EB9djL=TqKU90dzWokL-DqU5Crw@mail.gmail.com>
Date: Tue, 18 Jul 2023 16:08:22 +0800
From: David Gow <davidgow@...gle.com>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Brendan Higgins <brendan.higgins@...ux.dev>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Alice Ryhl <aliceryhl@...gle.com>,
Andreas Hindborg <nmi@...aspace.dk>,
kunit-dev@...glegroups.com, linux-kselftest@...r.kernel.org,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
patches@...ts.linux.dev
Subject: Re: [PATCH v2 1/7] kunit: test-bug.h: include `stddef.h` for `NULL`
On Tue, 18 Jul 2023 at 13:28, Miguel Ojeda <ojeda@...nel.org> wrote:
>
> 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 <boqun.feng@...il.com>
> Closes: https://lore.kernel.org/rust-for-linux/ZJ8cNUW3oR2p+gL1@boqun-archlinux/ [1]
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
> ---
Reviewed-by: David Gow <davidgow@...gle.com>
Thanks!
-- David
> include/kunit/test-bug.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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 <linux/stddef.h> /* for NULL */
> +
> #if IS_ENABLED(CONFIG_KUNIT)
>
> #include <linux/jump_label.h> /* For static branch */
> --
> 2.41.0
>
> --
> You received this message because you are subscribed to the Google Groups "KUnit Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kunit-dev+unsubscribe@...glegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kunit-dev/20230718052752.1045248-2-ojeda%40kernel.org.
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4003 bytes)
Powered by blists - more mailing lists