dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Airlie <airlied@linux.ie>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Jyri Sarha <jsarha@ti.com>, Tony Lindgren <tony@atomide.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	dri-devel@lists.freedesktop.org,
	zhong jiang <zhongjiang@huawei.com>
Subject: Re: [PATCH] omapdrm: no need to check return value of debugfs_create functions
Date: Thu, 8 Aug 2019 15:50:53 +0300	[thread overview]
Message-ID: <20190808125053.GJ6055@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20190613115749.GC26335@kroah.com>

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@ti.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
> Cc: Jyri Sarha <jsarha@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: zhong jiang <zhongjiang@huawei.com>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

This makes sense.

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

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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-08-08 12:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 11:57 [PATCH] omapdrm: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-08-08 12:50 ` Laurent Pinchart [this message]
2019-08-09  6:59   ` Tomi Valkeinen
2019-08-09  7:47     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190808125053.GJ6055@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsarha@ti.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.com \
    --cc=zhongjiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox