[igt-dev] [PATCH i-g-t 2/2] tests/amdgpu: Fix typo in amd_module_load

Rodrigo Siqueira Rodrigo.Siqueira at amd.com
Mon Jun 14 19:39:31 UTC 2021


Hi Anson,

Let's squash this patch with the previous one.

Thanks

On 06/14, Anson Jacob wrote:
> From: Victor Lu <victorchengchi.lu at amd.com>
> 
> A typo in amd_module_load was causing the test to fail.
> igt_assert_f(err, 0) should have been igt_assert_eq(err, 0),
> to check err == 0. Also added drm_fd >= 0 check and made
> ioctl query more explicit.
> 
> Signed-off-by: Victor Lu <victorchengchi.lu at amd.com>
> Acked-by: Anson Jacob <Anson.Jacob at amd.com>
> ---
>  tests/amdgpu/amd_module_load.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/amdgpu/amd_module_load.c b/tests/amdgpu/amd_module_load.c
> index e682d2c5..8762b2a2 100644
> --- a/tests/amdgpu/amd_module_load.c
> +++ b/tests/amdgpu/amd_module_load.c
> @@ -41,8 +41,10 @@ sanity_check(void)
>  	args.return_pointer = (uintptr_t) &arg_ret;
>  	args.return_size = sizeof(int);
>  	args.query = AMDGPU_INFO_HW_IP_INFO;
> +	args.query_hw_ip.type = AMDGPU_HW_IP_COMPUTE;
>  
>  	fd = drm_open_driver(DRIVER_AMDGPU);
> +	igt_assert_f(fd >= 0, "Module failed to load\n");
>  	igt_set_timeout(1, "Module reload timeout!");
>  
>  	if (ioctl(fd, DRM_IOCTL_AMDGPU_INFO, &args) < 0)
> @@ -51,7 +53,7 @@ sanity_check(void)
>  	igt_set_timeout(0, NULL);
>  	close(fd);
>  
> -	igt_assert_f(err, 0);
> +	igt_assert_eq(err, 0);
>  }
>  
>  igt_main
> -- 
> 2.25.1
> 

-- 
Rodrigo Siqueira
https://siqueira.tech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20210614/3a5ef838/attachment.sig>


More information about the igt-dev mailing list