[PATCH 3/3] drm/xe/xe_exec : In xe_exec_ioctl remove deadcode

Upadhyay, Tejas tejas.upadhyay at intel.com
Fri Mar 8 05:27:02 UTC 2024



> -----Original Message-----
> From: Ghimiray, Himal Prasad <himal.prasad.ghimiray at intel.com>
> Sent: Friday, March 8, 2024 10:07 AM
> To: intel-xe at lists.freedesktop.org
> Cc: Ghimiray, Himal Prasad <himal.prasad.ghimiray at intel.com>; Brost,
> Matthew <matthew.brost at intel.com>; Upadhyay, Tejas
> <tejas.upadhyay at intel.com>; Bommu, Krishnaiah
> <krishnaiah.bommu at intel.com>
> Subject: [PATCH 3/3] drm/xe/xe_exec : In xe_exec_ioctl remove deadcode
> 
> At label err_unlock_list the condition write_label will never be true.
> Remove the deadcode line for write_label true.
> 
> Reported by static analyzer.
> 
> Cc: Matthew Brost <matthew.brost at intel.com>
> Cc: Tejas Upadhyay <tejas.upadhyay at intel.com>
> Cc: Bommu Krishnaiah <krishnaiah.bommu at intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_exec.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
> index 952496c6260d..acc066e405d0 100644
> --- a/drivers/gpu/drm/xe/xe_exec.c
> +++ b/drivers/gpu/drm/xe/xe_exec.c
> @@ -380,10 +380,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data,
> struct drm_file *file)
>  err_exec:
>  	drm_exec_fini(exec);
>  err_unlock_list:
> -	if (write_locked)
> -		up_write(&vm->lock);
> -	else
> -		up_read(&vm->lock);
> +	up_read(&vm->lock);

LGTM,
As write_locked never going to be true here, this is possibly going to be dead code.
Reviewed-by: Tejas Upadhyay <tejas.upadhyay at intel.com>

>  	if (err == -EAGAIN && !skip_retry)
>  		goto retry;
>  err_syncs:
> --
> 2.25.1



More information about the Intel-xe mailing list