dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] panel: rocktech: no need to check return value of debugfs_create functions
@ 2019-06-13 11:57 Greg Kroah-Hartman
  2019-06-13 12:16 ` Guido Günther
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-06-13 11:57 UTC (permalink / raw)
  To: Guido Günther, Thierry Reding, David Airlie, Daniel Vetter; +Cc: dri-devel

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)
-- 
2.22.0

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] panel: rocktech: no need to check return value of debugfs_create functions
  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
  2019-06-13 13:09   ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Guido Günther @ 2019-06-13 12:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: David Airlie, Thierry Reding, dri-devel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] panel: rocktech: no need to check return value of debugfs_create functions
  2019-06-13 12:16 ` Guido Günther
@ 2019-06-13 13:09   ` Daniel Vetter
  2019-06-13 13:23     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2019-06-13 13:09 UTC (permalink / raw)
  To: Guido Günther
  Cc: David Airlie, Greg Kroah-Hartman, Thierry Reding, dri-devel

On Thu, Jun 13, 2019 at 02:16:16PM +0200, Guido Günther wrote:
> 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>

Applied to drm-misc-next, thanks.

For the others I'll assume drivers maintainers will pick them up. If not
pls ping/resend and I'll stuff all the remaining ones into drm-misc-next.

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] panel: rocktech: no need to check return value of debugfs_create functions
  2019-06-13 13:09   ` Daniel Vetter
@ 2019-06-13 13:23     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-06-13 13:23 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: David Airlie, Guido Günther, Thierry Reding, dri-devel

On Thu, Jun 13, 2019 at 03:09:53PM +0200, Daniel Vetter wrote:
> On Thu, Jun 13, 2019 at 02:16:16PM +0200, Guido Günther wrote:
> > 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>
> 
> Applied to drm-misc-next, thanks.
> 
> For the others I'll assume drivers maintainers will pick them up. If not
> pls ping/resend and I'll stuff all the remaining ones into drm-misc-next.

Thanks, will do.

greg k-h
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-13 13:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-06-13 13:09   ` Daniel Vetter
2019-06-13 13:23     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox