[Intel-xe] [PATCH] drm/xe: Remove unnecessary "ret" variable

Upadhyay, Tejas tejas.upadhyay at intel.com
Mon Nov 20 14:09:38 UTC 2023



> -----Original Message-----
> From: Andi Shyti <andi.shyti at linux.intel.com>
> Sent: Monday, November 20, 2023 4:49 PM
> To: Upadhyay, Tejas <tejas.upadhyay at intel.com>
> Cc: intel-xe <intel-xe at lists.freedesktop.org>; Andi Shyti
> <andi.shyti at linux.intel.com>
> Subject: [PATCH] drm/xe: Remove unnecessary "ret" variable
> 
> Just a trivial removal of "ret" that doesn't have a good reason to exist.
> 
> Signed-off-by: Andi Shyti <andi.shyti at linux.intel.com>
> ---
>  drivers/gpu/drm/xe/xe_device.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 8be765adf702..f5c7f19033e2 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -50,16 +50,15 @@ static int xe_file_open(struct drm_device *dev, struct
> drm_file *file)
>  	struct xe_device *xe = to_xe_device(dev);
>  	struct xe_drm_client *client;
>  	struct xe_file *xef;
> -	int ret = -ENOMEM;

I don't see any issue with the change. 
Reviewed-by: Tejas Upadhyay <tejas.upadhyay at intel.com>

> 
>  	xef = kzalloc(sizeof(*xef), GFP_KERNEL);
>  	if (!xef)
> -		return ret;
> +		return -ENOMEM;
> 
>  	client = xe_drm_client_alloc();
>  	if (!client) {
>  		kfree(xef);
> -		return ret;
> +		return -ENOMEM;
>  	}
> 
>  	xef->drm = file;
> --
> 2.42.0



More information about the Intel-xe mailing list