Re: [PATCH] omapdrm: no need to check return value of debugfs_create functions

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

 



Hi Greg,

Thank you for the patch.

On Thu, Jun 13, 2019 at 01:57:49PM +0200, Greg Kroah-Hartman wrote:
> When calling debugfs functions, there is no need to ever check the
> return value.  The function can work or not, but the code logic should
> never do something different based on this.
> 
> Cc: Tomi Valkeinen <tomi.valkeinen@xxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
> Cc: Daniel Vetter <daniel@xxxxxxxx>
> Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> Cc: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
> Cc: Jyri Sarha <jsarha@xxxxxx>
> Cc: Tony Lindgren <tony@xxxxxxxxxxx>
> Cc: zhong jiang <zhongjiang@xxxxxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

This makes sense.

Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

Tomi, will you take this patch in your tree ?

> ---
>  drivers/gpu/drm/omapdrm/dss/dss.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
> index 55e68863ef15..83b973813394 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dss.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dss.c
> @@ -934,7 +934,6 @@ dss_debugfs_create_file(struct dss_device *dss, const char *name,
>  			void *data)
>  {
>  	struct dss_debugfs_entry *entry;
> -	struct dentry *d;
>  
>  	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
>  	if (!entry)
> @@ -942,15 +941,9 @@ dss_debugfs_create_file(struct dss_device *dss, const char *name,
>  
>  	entry->show_fn = show_fn;
>  	entry->data = data;
> +	entry->dentry = debugfs_create_file(name, 0444, dss->debugfs.root,
> +					    entry, &dss_debug_fops);
>  
> -	d = debugfs_create_file(name, 0444, dss->debugfs.root, entry,
> -				&dss_debug_fops);
> -	if (IS_ERR(d)) {
> -		kfree(entry);
> -		return ERR_CAST(d);
> -	}
> -
> -	entry->dentry = d;
>  	return entry;
>  }
>  

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux