lkml.org 
[lkml]   [2023]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 01/12] drm/amd: Remove unused variable 'r'
On Mon, Mar 27, 2023 at 7:34 PM Caio Novais <caionovais@usp.br> wrote:
>
> Compiling AMD GPU drivers displays a warning:
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c: In function ‘amdgpu_mes_ctx_alloc_meta_data’:
> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1099:13: warning: variable ‘r’ set but not used [-Wunused-but-set-variable]
>
> Get rid of it by removing the variable.
>
> Signed-off-by: Caio Novais <caionovais@usp.br>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> index 82e27bd4f038..e0130536f778 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> @@ -1096,14 +1096,6 @@ uint32_t amdgpu_mes_get_aggregated_doorbell_index(struct amdgpu_device *adev,
> int amdgpu_mes_ctx_alloc_meta_data(struct amdgpu_device *adev,
> struct amdgpu_mes_ctx_data *ctx_data)
> {
> - int r;
> -
> - r = amdgpu_bo_create_kernel(adev,
> - sizeof(struct amdgpu_mes_ctx_meta_data),
> - PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
> - &ctx_data->meta_data_obj,
> - &ctx_data->meta_data_mc_addr,
> - &ctx_data->meta_data_ptr);

You can't just remove the buffer allocation here. If you want to fix
this then do something like
if (r)
return r;

Alex

> if (!ctx_data->meta_data_obj)
> return -ENOMEM;
>
> --
> 2.40.0
>

\
 
 \ /
  Last update: 2023-03-28 01:48    [W:0.092 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site