dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Guido Günther" <agx@sigxcpu.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Airlie <airlied@linux.ie>,
	Thierry Reding <thierry.reding@gmail.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] panel: rocktech: no need to check return value of debugfs_create functions
Date: Thu, 13 Jun 2019 14:16:16 +0200	[thread overview]
Message-ID: <20190613121616.GA5339@bogon.m.sigxcpu.org> (raw)
In-Reply-To: <20190613115717.GB26335@kroah.com>

Hi,
On Thu, Jun 13, 2019 at 01:57:17PM +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: "Guido Günther" <agx@sigxcpu.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
> index d88ea8da2ec2..6dcb692c4701 100644
> --- a/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
> +++ b/drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
> @@ -257,20 +257,12 @@ static int allpixelson_set(void *data, u64 val)
>  DEFINE_SIMPLE_ATTRIBUTE(allpixelson_fops, NULL,
>  			allpixelson_set, "%llu\n");
>  
> -static int jh057n_debugfs_init(struct jh057n *ctx)
> +static void jh057n_debugfs_init(struct jh057n *ctx)
>  {
> -	struct dentry *f;
> -
>  	ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
> -	if (!ctx->debugfs)
> -		return -ENOMEM;
>  
> -	f = debugfs_create_file("allpixelson", 0600,
> -				ctx->debugfs, ctx, &allpixelson_fops);
> -	if (!f)
> -		return -ENOMEM;
> -
> -	return 0;
> +	debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx,
> +			    &allpixelson_fops);
>  }
>  
>  static void jh057n_debugfs_remove(struct jh057n *ctx)

Reviewed-by: Guido Günther <agx@sigxcpu.org>

Thanks,
 -- Guido

> -- 
> 2.22.0
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-06-13 12:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 11:57 [PATCH] panel: rocktech: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-13 12:16 ` Guido Günther [this message]
2019-06-13 13:09   ` Daniel Vetter
2019-06-13 13:23     ` 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=20190613121616.GA5339@bogon.m.sigxcpu.org \
    --to=agx@sigxcpu.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=thierry.reding@gmail.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