diff options
author | David Gow <davidgow@google.com> | 2022-07-13 08:52:20 +0800 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2022-08-15 13:51:07 -0600 |
commit | 41a55567b9e31cb852670684404654ec4fd0d8d6 (patch) | |
tree | f9bcf2398e14466aa0b007d0592f6c1db7ce39d5 /kernel/module/main.c | |
parent | d52788b3da2750ebc617891cf260b8f8912f522b (diff) | |
download | linux-next-41a55567b9e31cb852670684404654ec4fd0d8d6.tar.gz |
module: kunit: Load .kunit_test_suites section when CONFIG_KUNIT=m
The new KUnit module handling has KUnit test suites listed in a
.kunit_test_suites section of each module. This should be loaded when
the module is, but at the moment this only happens if KUnit is built-in.
Also load this when KUnit is enabled as a module: it'll not be usable
unless KUnit is loaded, but such modules are likely to depend on KUnit
anyway, so it's unlikely to ever be loaded needlessly.
Fixes: 3d6e44623841 ("kunit: unify module and builtin suite definitions")
Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'kernel/module/main.c')
-rw-r--r-- | kernel/module/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/module/main.c b/kernel/module/main.c index 6a477c622544..a4e4d84b6f4e 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2099,7 +2099,7 @@ static int find_module_sections(struct module *mod, struct load_info *info) sizeof(*mod->static_call_sites), &mod->num_static_call_sites); #endif -#ifdef CONFIG_KUNIT +#if IS_ENABLED(CONFIG_KUNIT) mod->kunit_suites = section_objs(info, ".kunit_test_suites", sizeof(*mod->kunit_suites), &mod->num_kunit_suites); |