linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
       [not found] ` <20200227120232.19413-1-wambui.karugax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2020-02-27 12:02   ` Wambui Karuga
       [not found]     ` <20200227120232.19413-11-wambui.karugax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Wambui Karuga @ 2020-02-27 12:02 UTC (permalink / raw)
  To: daniel-/w4YWyX8dFk, airlied-cv59FeDIM0c, Thierry Reding,
	Jonathan Hunter
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

Since 987d65d01356 (drm: debugfs: make
drm_debugfs_create_files() never fail) there is no need to check the
return value of drm_debugfs_create_files(). Therefore, remove the
return checks and error handling of the drm_debugfs_create_files()
function from various debugfs init functions in drm/tegra and have
them return 0 directly.

This change also includes removing the use of drm_debugfs_create_files
as a return value in tegra_debugfs_init() and have the function declared
as void.

Signed-off-by: Wambui Karuga <wambui.karugax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/gpu/drm/tegra/dc.c   | 11 +----------
 drivers/gpu/drm/tegra/drm.c  |  8 ++++----
 drivers/gpu/drm/tegra/dsi.c  | 11 +----------
 drivers/gpu/drm/tegra/hdmi.c | 11 +----------
 drivers/gpu/drm/tegra/sor.c  | 11 +----------
 5 files changed, 8 insertions(+), 44 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 7c70fd31a4c2..e70d58b21964 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1496,7 +1496,6 @@ static int tegra_dc_late_register(struct drm_crtc *crtc)
 	struct drm_minor *minor = crtc->dev->primary;
 	struct dentry *root;
 	struct tegra_dc *dc = to_tegra_dc(crtc);
-	int err;
 
 #ifdef CONFIG_DEBUG_FS
 	root = crtc->debugfs_entry;
@@ -1512,17 +1511,9 @@ static int tegra_dc_late_register(struct drm_crtc *crtc)
 	for (i = 0; i < count; i++)
 		dc->debugfs_files[i].data = dc;
 
-	err = drm_debugfs_create_files(dc->debugfs_files, count, root, minor);
-	if (err < 0)
-		goto free;
+	drm_debugfs_create_files(dc->debugfs_files, count, root, minor);
 
 	return 0;
-
-free:
-	kfree(dc->debugfs_files);
-	dc->debugfs_files = NULL;
-
-	return err;
 }
 
 static void tegra_dc_early_unregister(struct drm_crtc *crtc)
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index bd268028fb3d..d4f51b5c7ee5 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -839,11 +839,11 @@ static struct drm_info_list tegra_debugfs_list[] = {
 	{ "iova", tegra_debugfs_iova, 0 },
 };
 
-static int tegra_debugfs_init(struct drm_minor *minor)
+static void tegra_debugfs_init(struct drm_minor *minor)
 {
-	return drm_debugfs_create_files(tegra_debugfs_list,
-					ARRAY_SIZE(tegra_debugfs_list),
-					minor->debugfs_root, minor);
+	drm_debugfs_create_files(tegra_debugfs_list,
+				 ARRAY_SIZE(tegra_debugfs_list),
+				 minor->debugfs_root, minor);
 }
 #endif
 
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 88b9d64c77bf..30626fcf61eb 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -234,7 +234,6 @@ static int tegra_dsi_late_register(struct drm_connector *connector)
 	struct drm_minor *minor = connector->dev->primary;
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_dsi *dsi = to_dsi(output);
-	int err;
 
 	dsi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				     GFP_KERNEL);
@@ -244,17 +243,9 @@ static int tegra_dsi_late_register(struct drm_connector *connector)
 	for (i = 0; i < count; i++)
 		dsi->debugfs_files[i].data = dsi;
 
-	err = drm_debugfs_create_files(dsi->debugfs_files, count, root, minor);
-	if (err < 0)
-		goto free;
+	drm_debugfs_create_files(dsi->debugfs_files, count, root, minor);
 
 	return 0;
-
-free:
-	kfree(dsi->debugfs_files);
-	dsi->debugfs_files = NULL;
-
-	return err;
 }
 
 static void tegra_dsi_early_unregister(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 6f117628f257..d7799d13d8ad 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1064,7 +1064,6 @@ static int tegra_hdmi_late_register(struct drm_connector *connector)
 	struct drm_minor *minor = connector->dev->primary;
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_hdmi *hdmi = to_hdmi(output);
-	int err;
 
 	hdmi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				      GFP_KERNEL);
@@ -1074,17 +1073,9 @@ static int tegra_hdmi_late_register(struct drm_connector *connector)
 	for (i = 0; i < count; i++)
 		hdmi->debugfs_files[i].data = hdmi;
 
-	err = drm_debugfs_create_files(hdmi->debugfs_files, count, root, minor);
-	if (err < 0)
-		goto free;
+	drm_debugfs_create_files(hdmi->debugfs_files, count, root, minor);
 
 	return 0;
-
-free:
-	kfree(hdmi->debugfs_files);
-	hdmi->debugfs_files = NULL;
-
-	return err;
 }
 
 static void tegra_hdmi_early_unregister(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 81226a4953c1..47c1d133069a 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -1687,7 +1687,6 @@ static int tegra_sor_late_register(struct drm_connector *connector)
 	struct drm_minor *minor = connector->dev->primary;
 	struct dentry *root = connector->debugfs_entry;
 	struct tegra_sor *sor = to_sor(output);
-	int err;
 
 	sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files),
 				     GFP_KERNEL);
@@ -1697,17 +1696,9 @@ static int tegra_sor_late_register(struct drm_connector *connector)
 	for (i = 0; i < count; i++)
 		sor->debugfs_files[i].data = sor;
 
-	err = drm_debugfs_create_files(sor->debugfs_files, count, root, minor);
-	if (err < 0)
-		goto free;
+	drm_debugfs_create_files(sor->debugfs_files, count, root, minor);
 
 	return 0;
-
-free:
-	kfree(sor->debugfs_files);
-	sor->debugfs_files = NULL;
-
-	return err;
 }
 
 static void tegra_sor_early_unregister(struct drm_connector *connector)
-- 
2.25.0

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

* Re: [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
       [not found]     ` <20200227120232.19413-11-wambui.karugax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2020-03-11 14:37       ` Thierry Reding
  2020-03-11 14:54         ` Wambui Karuga
  0 siblings, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2020-03-11 14:37 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel-/w4YWyX8dFk, airlied-cv59FeDIM0c, Jonathan Hunter,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

On Thu, Feb 27, 2020 at 03:02:21PM +0300, Wambui Karuga wrote:
> Since 987d65d01356 (drm: debugfs: make
> drm_debugfs_create_files() never fail) there is no need to check the
> return value of drm_debugfs_create_files(). Therefore, remove the
> return checks and error handling of the drm_debugfs_create_files()
> function from various debugfs init functions in drm/tegra and have
> them return 0 directly.
> 
> This change also includes removing the use of drm_debugfs_create_files
> as a return value in tegra_debugfs_init() and have the function declared
> as void.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/gpu/drm/tegra/dc.c   | 11 +----------
>  drivers/gpu/drm/tegra/drm.c  |  8 ++++----
>  drivers/gpu/drm/tegra/dsi.c  | 11 +----------
>  drivers/gpu/drm/tegra/hdmi.c | 11 +----------
>  drivers/gpu/drm/tegra/sor.c  | 11 +----------
>  5 files changed, 8 insertions(+), 44 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
  2020-03-11 14:37       ` Thierry Reding
@ 2020-03-11 14:54         ` Wambui Karuga
  2020-03-11 23:24           ` Thierry Reding
  0 siblings, 1 reply; 5+ messages in thread
From: Wambui Karuga @ 2020-03-11 14:54 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Wambui Karuga, daniel-/w4YWyX8dFk, airlied-cv59FeDIM0c,
	Jonathan Hunter, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

Hey Thierry,

On Wed, 11 Mar 2020, Thierry Reding wrote:

> On Thu, Feb 27, 2020 at 03:02:21PM +0300, Wambui Karuga wrote:
>> Since 987d65d01356 (drm: debugfs: make
>> drm_debugfs_create_files() never fail) there is no need to check the
>> return value of drm_debugfs_create_files(). Therefore, remove the
>> return checks and error handling of the drm_debugfs_create_files()
>> function from various debugfs init functions in drm/tegra and have
>> them return 0 directly.
>>
>> This change also includes removing the use of drm_debugfs_create_files
>> as a return value in tegra_debugfs_init() and have the function declared
>> as void.
>>
>> Signed-off-by: Wambui Karuga <wambui.karugax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>>  drivers/gpu/drm/tegra/dc.c   | 11 +----------
>>  drivers/gpu/drm/tegra/drm.c  |  8 ++++----
>>  drivers/gpu/drm/tegra/dsi.c  | 11 +----------
>>  drivers/gpu/drm/tegra/hdmi.c | 11 +----------
>>  drivers/gpu/drm/tegra/sor.c  | 11 +----------
>>  5 files changed, 8 insertions(+), 44 deletions(-)
>
> Applied, thanks.
>
There's a newer version[1] of this patch series as this specific patch 
depends on other work in drm.

Thanks,
wambui karuga.

[1] https://lists.freedesktop.org/archives/dri-devel/2020-March/258793.html
> Thierry
>

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

* Re: [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
  2020-03-11 14:54         ` Wambui Karuga
@ 2020-03-11 23:24           ` Thierry Reding
  2020-03-16  8:33             ` Daniel Vetter
  0 siblings, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2020-03-11 23:24 UTC (permalink / raw)
  To: Wambui Karuga
  Cc: daniel-/w4YWyX8dFk, airlied-cv59FeDIM0c, Jonathan Hunter,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1697 bytes --]

On Wed, Mar 11, 2020 at 05:54:46PM +0300, Wambui Karuga wrote:
> Hey Thierry,
> 
> On Wed, 11 Mar 2020, Thierry Reding wrote:
> 
> > On Thu, Feb 27, 2020 at 03:02:21PM +0300, Wambui Karuga wrote:
> > > Since 987d65d01356 (drm: debugfs: make
> > > drm_debugfs_create_files() never fail) there is no need to check the
> > > return value of drm_debugfs_create_files(). Therefore, remove the
> > > return checks and error handling of the drm_debugfs_create_files()
> > > function from various debugfs init functions in drm/tegra and have
> > > them return 0 directly.
> > > 
> > > This change also includes removing the use of drm_debugfs_create_files
> > > as a return value in tegra_debugfs_init() and have the function declared
> > > as void.
> > > 
> > > Signed-off-by: Wambui Karuga <wambui.karugax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > > ---
> > >  drivers/gpu/drm/tegra/dc.c   | 11 +----------
> > >  drivers/gpu/drm/tegra/drm.c  |  8 ++++----
> > >  drivers/gpu/drm/tegra/dsi.c  | 11 +----------
> > >  drivers/gpu/drm/tegra/hdmi.c | 11 +----------
> > >  drivers/gpu/drm/tegra/sor.c  | 11 +----------
> > >  5 files changed, 8 insertions(+), 44 deletions(-)
> > 
> > Applied, thanks.
> > 
> There's a newer version[1] of this patch series as this specific patch
> depends on other work in drm.

Oh yeah, I just noticed that this patch causes a build failure, so I
backed it out again.

If there's dependencies on other work, it's probably best to take this
through drm-misc, in which case:

Acked-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Let me know if you'd prefer me to apply this to drm/tegra instead.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value
  2020-03-11 23:24           ` Thierry Reding
@ 2020-03-16  8:33             ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2020-03-16  8:33 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Wambui Karuga, daniel, airlied, Jonathan Hunter, linux-kernel,
	gregkh, dri-devel, linux-tegra

On Thu, Mar 12, 2020 at 12:24:46AM +0100, Thierry Reding wrote:
> On Wed, Mar 11, 2020 at 05:54:46PM +0300, Wambui Karuga wrote:
> > Hey Thierry,
> > 
> > On Wed, 11 Mar 2020, Thierry Reding wrote:
> > 
> > > On Thu, Feb 27, 2020 at 03:02:21PM +0300, Wambui Karuga wrote:
> > > > Since 987d65d01356 (drm: debugfs: make
> > > > drm_debugfs_create_files() never fail) there is no need to check the
> > > > return value of drm_debugfs_create_files(). Therefore, remove the
> > > > return checks and error handling of the drm_debugfs_create_files()
> > > > function from various debugfs init functions in drm/tegra and have
> > > > them return 0 directly.
> > > > 
> > > > This change also includes removing the use of drm_debugfs_create_files
> > > > as a return value in tegra_debugfs_init() and have the function declared
> > > > as void.
> > > > 
> > > > Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
> > > > ---
> > > >  drivers/gpu/drm/tegra/dc.c   | 11 +----------
> > > >  drivers/gpu/drm/tegra/drm.c  |  8 ++++----
> > > >  drivers/gpu/drm/tegra/dsi.c  | 11 +----------
> > > >  drivers/gpu/drm/tegra/hdmi.c | 11 +----------
> > > >  drivers/gpu/drm/tegra/sor.c  | 11 +----------
> > > >  5 files changed, 8 insertions(+), 44 deletions(-)
> > > 
> > > Applied, thanks.
> > > 
> > There's a newer version[1] of this patch series as this specific patch
> > depends on other work in drm.
> 
> Oh yeah, I just noticed that this patch causes a build failure, so I
> backed it out again.
> 
> If there's dependencies on other work, it's probably best to take this
> through drm-misc, in which case:
> 
> Acked-by: Thierry Reding <treding@nvidia.com>
> 
> Let me know if you'd prefer me to apply this to drm/tegra instead.

Yeah I'm going to pull in the entire series through -misc rsn.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

end of thread, other threads:[~2020-03-16  8:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20200227120232.19413-1-wambui.karugax@gmail.com>
     [not found] ` <20200227120232.19413-1-wambui.karugax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-02-27 12:02   ` [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value Wambui Karuga
     [not found]     ` <20200227120232.19413-11-wambui.karugax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-03-11 14:37       ` Thierry Reding
2020-03-11 14:54         ` Wambui Karuga
2020-03-11 23:24           ` Thierry Reding
2020-03-16  8:33             ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).