Re: [PATCH linux-kselftest-test 2/3] kunit: allow kunit to be loaded as a module

From: Alan Maguire
Date: Tue Oct 08 2019 - 11:16:21 EST


On Tue, 8 Oct 2019, Andy Shevchenko wrote:

> On Tue, Oct 08, 2019 at 03:43:51PM +0100, Alan Maguire wrote:
> > Making kunit itself buildable as a module allows for "always-on"
> > kunit configuration; specifying CONFIG_KUNIT=m means the module
> > is built but only used when loaded. Kunit test modules will load
> > kunit.ko as an implicit dependency, so simply running
> > "modprobe my-kunit-tests" will load the tests along with the kunit
> > module and run them.
>
> > +#ifdef MODULE
>
> > +#endif /* MODULE */
>
> This is strange. Why do you need ifdef?
>

Ah, this was an incorrect assumption on my part; I thought that
declaring a module license for built-in code might trigger a warning
during build. I'll remove the #ifdef MODULE around licenses in v3 (v2 has
already gone out as I mistakenly initially sent the wrong version of the
patches). I've verified that removing it triggers no warnings.

Thanks to you and Randy for spotting this!

Alan

> --
> With Best Regards,
> Andy Shevchenko
>
>
>