[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VeyCujEX3dFBVF=ioHOqPbWQRtuB7_zFGndAejYbMW05w@mail.gmail.com>
Date: Sun, 21 Sep 2025 21:25:39 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Lukas Wunner <lukas@...ner.de>
Cc: Alexander Potapenko <glider@...gle.com>, Ethan Graham <ethan.w.s.graham@...il.com>,
ethangraham@...gle.com, andreyknvl@...il.com, andy@...nel.org,
brauner@...nel.org, brendan.higgins@...ux.dev, davem@...emloft.net,
davidgow@...gle.com, dhowells@...hat.com, dvyukov@...gle.com,
elver@...gle.com, herbert@...dor.apana.org.au, ignat@...udflare.com,
jack@...e.cz, jannh@...gle.com, johannes@...solutions.net,
kasan-dev@...glegroups.com, kees@...nel.org, kunit-dev@...glegroups.com,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, rmoar@...gle.com, shuah@...nel.org, sj@...nel.org,
tarasmadan@...gle.com
Subject: Re: [PATCH v2 08/10] drivers/auxdisplay: add a KFuzzTest for parse_xy()
On Sat, Sep 20, 2025 at 3:47 PM Lukas Wunner <lukas@...ner.de> wrote:
> On Sat, Sep 20, 2025 at 02:08:01PM +0200, Alexander Potapenko wrote:
> > On Sat, Sep 20, 2025 at 12:54 PM Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> > > On Fri, Sep 19, 2025 at 5:58 PM Ethan Graham <ethan.w.s.graham@...il.com> wrote:
...
> > > > +/*
> > > > + * When CONFIG_KFUZZTEST is enabled, we include this _kfuzz.c file to ensure
> > > > + * that KFuzzTest targets are built.
> > > > + */
> > > > +#ifdef CONFIG_KFUZZTEST
> > > > +#include "tests/charlcd_kfuzz.c"
> > > > +#endif /* CONFIG_KFUZZTEST */
> > >
> > > No, NAK. We don't want to see these in each and every module. Please,
> > > make sure that nothing, except maybe Kconfig, is modified in this
> > > folder (yet, you may add a _separate_ test module, as you already have
> > > done in this patch).
> >
> > This is one of the cases in which we can't go without changing the
> > original code, because parse_xy() is a static function.
> > Including the test into the source is not the only option, we could as
> > well make the function visible unconditionally, or introduce a macro
> > similar to VISIBLE_IF_KUNIT.
> > Do you prefer any of those?
>
> Just add something like this to drivers/auxdisplay/Makefile:
>
> ifeq ($(CONFIG_KFUZZTEST),y)
> CFLAGS_charlcd.o := -include $(src)/tests/charlcd_kfuzz.c
> endif
>
> Alternatively, if the file in tests/ always has the same name
> as the source file but with "_kfuzz.c" suffix, consider amending
> scripts/Makefile.build to always include the "_kfuzz.c" file
> if it exists and CONFIG_KFUZZTEST=y, thus avoiding the need
> to amend all the individual Makefiles in the tree.
Thanks, Lukas, for the ideas. Yes, something like this would be acceptable.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists