Re: [PATCH 2/2] spi: Add KUnit coverage for DMA mapping error paths

Andy Shevchenko <[email protected]>
Newsgroups org.kernel.vger.linux-spi,org.kernel.vger.linux-kernel
Message-ID <CAHp75Vdhu9QC5D56ZDDYx_x6TqU+FR4KfZP_fdoBDxP7-YuaAw@mail.gmail.com>
On Thu, Aug 6, 2026 at 12:57 AM Mark Brown <[email protected]> wrote:
> On Wed, Aug 05, 2026 at 11:14:56PM +0800, Honghui Jiang wrote:

...

> >  postcore_initcall(spi_init);
> > +
> > +#ifdef CONFIG_SPI_KUNIT_TEST
> > +#include "tests/spi_kunit.c"
> > +#endif
>
> If this is just so we can peer into the internals it'd be better to add
> a local header for internals and build as a separate translation unit
> like normal rather than doing this sort of bodge.

Yep, and we have kunit/visibility.h in case it is needed.

> > diff --git a/drivers/spi/tests/spi_kunit.c b/drivers/spi/tests/spi_kunit.c
>
> Everywhere else we use - as a separator.

I think for kunit tests there is a pattern which is xxx_kunit.c.

-- 
With Best Regards,
Andy Shevchenko
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.