On 3/26/26 09:55, Sunil Khatri wrote:
> In function amdgpu_userq_evict use the function return
> value in the if condition instead.
> 
> Signed-off-by: Sunil Khatri <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> index aa0e6eea9436..2a1832fce6d2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
> @@ -1308,17 +1308,13 @@ void
>  amdgpu_userq_evict(struct amdgpu_userq_mgr *uq_mgr)
>  {
>       struct amdgpu_device *adev = uq_mgr->adev;
> -     int ret;
>  
>       /* Wait for any pending userqueue fence work to finish */
> -     ret = amdgpu_userq_wait_for_signal(uq_mgr);
> -     if (ret)
> +     if (amdgpu_userq_wait_for_signal(uq_mgr))
>               dev_err(adev->dev, "Not evicting userqueue, timeout waiting for 
> work\n");

That actually looks like a pretty bad idea. Instead we should start printing 
the error code.

But before we do that I would rather like to know why 
amdgpu_userq_wait_for_signal() can fail?

That should never happen in the first place.

Regards,
Christian.

>  
> -     ret = amdgpu_userq_evict_all(uq_mgr);
> -     if (ret)
> +     if (amdgpu_userq_evict_all(uq_mgr))
>               dev_err(adev->dev, "Failed to evict userqueue\n");
> -
>  }
>  
>  int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct 
> drm_file *file_priv,

Reply via email to