diff mbox series

[i-g-t,v2,02/17] lib/kunit: Stop loading kunit module explicitly

Message ID 20230908123233.137134-21-janusz.krzysztofik@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Fix IGT Kunit implementation issues | expand

Commit Message

Janusz Krzysztofik Sept. 8, 2023, 12:32 p.m. UTC
Since kmod functions we use for module loading can process module
dependencies, there is no need to load the "kunit" module explicitly
before loading a kunit test module.  For the same reason we already don't
unload the "kunit" module explicitly on cleanup.  Drop the unnecessary
operation.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 lib/igt_kmod.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Mauro Carvalho Chehab Sept. 15, 2023, 10:36 a.m. UTC | #1
On Fri,  8 Sep 2023 14:32:36 +0200
Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> wrote:

> Since kmod functions we use for module loading can process module
> dependencies, there is no need to load the "kunit" module explicitly
> before loading a kunit test module.  For the same reason we already don't
> unload the "kunit" module explicitly on cleanup.  Drop the unnecessary
> operation.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>

LGTM.

Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org>

> ---
>  lib/igt_kmod.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index 97667a896f..faf31afabc 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -789,12 +789,6 @@ static void __igt_kunit(const char *module_name, const char *opts)
>  		goto unload;
>  	}
>  
> -	/* The KUnit module is required for running any KUnit tests */
> -	ret = igt_kmod_load("kunit", NULL);
> -	if (ret) {
> -		skip = ret;
> -		goto unload;
> -	}
>  	ret = kmod_module_new_from_name(kmod_ctx(), "kunit", &kunit_kmod);
>  	if (ret) {
>  		igt_warn("Unable to load KUnit\n");
diff mbox series

Patch

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 97667a896f..faf31afabc 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -789,12 +789,6 @@  static void __igt_kunit(const char *module_name, const char *opts)
 		goto unload;
 	}
 
-	/* The KUnit module is required for running any KUnit tests */
-	ret = igt_kmod_load("kunit", NULL);
-	if (ret) {
-		skip = ret;
-		goto unload;
-	}
 	ret = kmod_module_new_from_name(kmod_ctx(), "kunit", &kunit_kmod);
 	if (ret) {
 		igt_warn("Unable to load KUnit\n");