Re: [PATCH 2/2] spi: Add KUnit coverage for DMA mapping error paths
From: Andy Shevchenko
Date: Thu Aug 06 2026 - 15:33:52 EST
On Thu, Aug 6, 2026 at 12:57 AM Mark Brown <broonie@xxxxxxxxxx> 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