[PATCH i-g-t] tests/amdgpu:fix vm test issue

Kamil Konieczny kamil.konieczny at linux.intel.com
Fri Jan 5 09:42:24 UTC 2024


Hi Jesse,
On 2024-01-05 at 13:18:28 +0800, Jesse Zhang wrote:

write in subject what test do you fix. Note also a space after
':', s/:fix/: fix/

Instead of:

[PATCH i-g-t] tests/amdgpu:fix vm test issue
-------------------------^-^

this should be:

[PATCH i-g-t] tests/amdgpu/amd_vm: fix vm test issue

Note also a space after ':', ":fix" --> ": fix".

> Initialize the variable "r" before using it.

Write also which (sub)test(s) it fixes.

> 
> Cc: Vitaly Prosyak <vitaly.prosyak at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: Christian Koenig <christian.koenig at amd.com>
> Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> 

Remove this empty line. You could add here gitlab link it fixes here
(if there is any you know).

> Signed-off-by: Jesse Zhang <Jesse.Zhang at amd.com>
> ---
>  tests/amdgpu/amd_vm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/amdgpu/amd_vm.c b/tests/amdgpu/amd_vm.c
> index dab91f291..bb7b6f173 100644
> --- a/tests/amdgpu/amd_vm.c
> +++ b/tests/amdgpu/amd_vm.c
> @@ -127,7 +127,8 @@ amdgpu_vm_unaligned_map(amdgpu_device_handle device_handle)
>  	request.preferred_heap = AMDGPU_GEM_DOMAIN_VRAM;
>  	request.flags = AMDGPU_GEM_CREATE_NO_CPU_ACCESS;
>  
> -	if (-ENOMEM == amdgpu_bo_alloc(device_handle, &request, &buf_handle)) {
> +	r = amdgpu_bo_alloc(device_handle, &request, &buf_handle);
> +	if (-ENOMEM == r) {

Why not other way around?
	if (r == -ENOMEM) {

looks better.

Regards,
Kamil

>  		/* Try allocate on the device of small memory */
>  		request.alloc_size = 8ULL << 20;
>  		map_size = (8ULL << 20) - (2 << 12);
> -- 
> 2.25.1
> 


More information about the igt-dev mailing list