From: Kees Cook <kees@kernel.org>
To: Carlos Llamas <cmllamas@google.com>
Cc: "Tiffany Yang" <ynaffit@google.com>,
linux-kernel@vger.kernel.org, kernel-team@android.com,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Martijn Coenen" <maco@android.com>,
"Joel Fernandes" <joelagnelf@nvidia.com>,
"Christian Brauner" <brauner@kernel.org>,
"Suren Baghdasaryan" <surenb@google.com>,
"Brendan Higgins" <brendan.higgins@linux.dev>,
"David Gow" <davidgow@google.com>, "Rae Moar" <rmoar@google.com>,
linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com
Subject: Re: [PATCH v3 4/6] binder: Scaffolding for binder_alloc KUnit tests
Date: Wed, 16 Jul 2025 23:22:53 -0700 [thread overview]
Message-ID: <202507162321.33950FA92A@keescook> (raw)
In-Reply-To: <aHgq8nub0DaIMPbp@google.com>
On Wed, Jul 16, 2025 at 10:42:58PM +0000, Carlos Llamas wrote:
> On Wed, Jul 16, 2025 at 03:28:49PM -0700, Tiffany Yang wrote:
> > Kees Cook <kees@kernel.org> writes:
> >
> > > > ...
> >
> > > I'm used to the "#ifdef CONFIG_..." idiom, but looking at the tree, I
> > > see that "#if IS_ENANLED(CONFIG...)" is relatively common too. I don't
> > > think there is a function difference, so I leave the style choice up to
> > > you! ;)
> >
> >
> > IIRC, I had tried using the #ifdef to inject test-specific code in some
> > places, but that created issues when we were loading KUnit as a module
> > because it causes the built-in code to be built as though the
> > "CONFIG_..." is undefined. Consequently, I started using IS_ENABLED by
> > default, but I'm not sure if it's strictly necessary for exposing
> > functions with a header file since I'd assume "CONFIG_..." will be
> > defined when we're building the module?
>
> Right, IS_ENABLED() is the "short-hand" for ...
> #if defined(CONFIG_x) || defined(CONFIG_x_MODULE)
> ... which is what we need here.
Ah-ha! Okay, thanks for the explanation. I don't do much module work,
it seems. ;)
--
Kees Cook
next prev parent reply other threads:[~2025-07-17 6:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-14 18:53 [PATCH v3 0/6] binder: Set up KUnit tests for alloc Tiffany Yang
2025-07-14 18:53 ` [PATCH v3 1/6] binder: Fix selftest page indexing Tiffany Yang
2025-07-15 4:52 ` Carlos Llamas
2025-07-16 14:27 ` Kees Cook
2025-07-16 22:07 ` Tiffany Yang
2025-07-14 18:53 ` [PATCH v3 2/6] binder: Store lru freelist in binder_alloc Tiffany Yang
2025-07-15 4:52 ` Carlos Llamas
2025-07-16 14:30 ` Kees Cook
2025-07-16 22:11 ` Tiffany Yang
2025-07-14 18:53 ` [PATCH v3 3/6] kunit: test: Export kunit_attach_mm() Tiffany Yang
2025-07-15 4:52 ` Carlos Llamas
2025-07-16 14:32 ` Kees Cook
2025-07-14 18:53 ` [PATCH v3 4/6] binder: Scaffolding for binder_alloc KUnit tests Tiffany Yang
2025-07-15 4:52 ` Carlos Llamas
2025-07-16 22:16 ` Tiffany Yang
2025-07-16 14:37 ` Kees Cook
2025-07-16 22:28 ` Tiffany Yang
2025-07-16 22:42 ` Carlos Llamas
2025-07-17 6:22 ` Kees Cook [this message]
2025-07-14 18:53 ` [PATCH v3 5/6] binder: Convert binder_alloc selftests to KUnit Tiffany Yang
2025-07-15 4:52 ` Carlos Llamas
2025-07-14 18:53 ` [PATCH v3 6/6] binder: encapsulate individual alloc test cases Tiffany Yang
2025-07-15 4:52 ` Carlos Llamas
2025-07-16 14:53 ` Kees Cook
2025-07-16 22:30 ` Tiffany Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202507162321.33950FA92A@keescook \
--to=kees@kernel.org \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=brendan.higgins@linux.dev \
--cc=cmllamas@google.com \
--cc=davidgow@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=joelagnelf@nvidia.com \
--cc=kernel-team@android.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maco@android.com \
--cc=rmoar@google.com \
--cc=surenb@google.com \
--cc=tkjos@android.com \
--cc=ynaffit@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.