[PATCH i-g-t v2 2/6] lib/kmode: Prepare open_parameters() helper for reuse by kunit

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Feb 1 14:37:13 UTC 2024


Hi Janusz,
On 2024-01-31 at 19:03:49 +0100, Janusz Krzysztofik wrote:
> Move the open_parameters() helper code up in the source file, above the
> kunit related functions, so it is available to follow-up changes of the
> kunit code.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  lib/igt_kmod.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index ad69173151..d1091bdc79 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -803,6 +803,14 @@ void igt_kselftest_get_tests(struct kmod_module *kmod,
>  	kmod_module_info_free_list(pre);
>  }
>  
> +static int open_parameters(const char *module_name)
> +{
> +	char path[256];
> +
> +	snprintf(path, sizeof(path), "/sys/module/%s/parameters", module_name);
> +	return open(path, O_RDONLY);
> +}
> +
>  struct modprobe_data {
>  	struct kmod_module *kmod;
>  	const char *opts;
> @@ -1402,14 +1410,6 @@ void igt_kunit(const char *module_name, const char *name, const char *opts)
>  	igt_ktest_fini(&tst);
>  }
>  
> -static int open_parameters(const char *module_name)
> -{
> -	char path[256];
> -
> -	snprintf(path, sizeof(path), "/sys/module/%s/parameters", module_name);
> -	return open(path, O_RDONLY);
> -}
> -
>  int igt_ktest_init(struct igt_ktest *tst,
>  		   const char *module_name)
>  {
> -- 
> 2.43.0
> 


More information about the igt-dev mailing list