On Wed, Feb 25, 2026 at 8:14 AM Srinivasan Shanmugam
<[email protected]> wrote:
>
> Clang warns that comparing a __u16 value against 65536 is always false.
>
> num_syncobj_timeline_handles is defined as __u16, so it can never exceed
> 65535.
>
> v2: Drop the check instead of changing the limit value. (Christian)
>
> Fixes the below:
> amdgpu_userq_fence.c:642:46: warning: result of comparison of constant 65536 
> with expression of type '__u16' (aka 'unsigned short') is always false 
> [-Wtautological-constant-out-of-range-compare]
>             wait_info->num_syncobj_timeline_handles > 
> AMDGPU_USERQ_MAX_HANDLES ||
>
> Cc: Alex Deucher <[email protected]>
> Cc: Christian König <[email protected]>
> Signed-off-by: Srinivasan Shanmugam <[email protected]>

Please add a Fixes: line.
With that,
Reviewed-by: Alex Deucher <[email protected]>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> index 136071172111..3c30512a6266 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> @@ -637,7 +637,6 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void 
> *data,
>                 return -ENOTSUPP;
>
>         if (wait_info->num_syncobj_handles > AMDGPU_USERQ_MAX_HANDLES ||
> -           wait_info->num_syncobj_timeline_handles > 
> AMDGPU_USERQ_MAX_HANDLES ||
>             wait_info->num_bo_write_handles > AMDGPU_USERQ_MAX_HANDLES ||
>             wait_info->num_bo_read_handles > AMDGPU_USERQ_MAX_HANDLES)
>                 return -EINVAL;
> --
> 2.34.1
>

Reply via email to