Re: [PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Am 22.07.2016 17:48, schrieb SF Markus Elfring:
> From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> Date: Fri, 22 Jul 2016 16:45:22 +0200
> 
> Move a return statement into a block for successful function execution.
> Omit a duplicate check for the local variable "ret" then at the end.
> 
> Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gem.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index 8eee742..851a8ba 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -661,13 +661,9 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev,
>  		 */
>  		mapping = obj->filp->f_mapping;
>  		mapping_set_gfp_mask(mapping, GFP_HIGHUSER);
> +		return obj;
>  	}
>  
> -	if (ret)
> -		goto fail;
> -
> -	return obj;
> -
>  fail:
>  	drm_gem_object_unreference_unlocked(obj);
>  	return ERR_PTR(ret);


>From the program flow an readability it would be more nice the branch on error

 ret = drm_gem_object_init(dev, obj, size);
 if (ret)
	goto fail;


just m 2 cents

re,
 wh
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux