[PATCH libdrm] amdgpu: add error return value for finding bo by cpu mapping
Christian König
christian.koenig at amd.com
Thu Aug 30 08:54:33 UTC 2018
Am 30.08.2018 um 10:50 schrieb Junwei Zhang:
> If nothing is found, error should be returned.
>
> Signed-off-by: Junwei Zhang <Jerry.Zhang at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
> ---
> amdgpu/amdgpu_bo.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
> index 2f4f90f..3812c5e 100644
> --- a/amdgpu/amdgpu_bo.c
> +++ b/amdgpu/amdgpu_bo.c
> @@ -550,6 +550,7 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
> uint64_t *offset_in_bo)
> {
> uint32_t i;
> + int r = 0;
> struct amdgpu_bo *bo;
BTW: Kernel coding style usually uses reverse xmas tree for variables.
E.g. longest line first and variable like "i" or "r" last.
But not a big issue,
Christian.
>
> if (cpu == NULL || size == 0)
> @@ -577,10 +578,11 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
> } else {
> *buf_handle = NULL;
> *offset_in_bo = 0;
> + r = -EINVAL;
> }
> pthread_mutex_unlock(&dev->bo_table_mutex);
>
> - return 0;
> + return r;
> }
>
> int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
More information about the amd-gfx
mailing list