All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] dri: do not check for NULL debugfs dentry
@ 2021-10-11 19:06 ` Nirmoy Das
  0 siblings, 0 replies; 20+ messages in thread
From: Nirmoy Das @ 2021-10-11 19:06 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Nirmoy Das, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter

Debugfs APIs returns encoded error on failure instead of NULL
and for drm primary/minor debugfs directories, we save the
returned value in the dentry pointer and pass it on to drm
drivers to further create debugfs files/directories. Error
conditions are handled by debugfs APIs, so no need to check
for NULL, as saved dentry pointers will either contain a
valid pointer or an error code.

CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
CC: Maxime Ripard <mripard@kernel.org>
CC: Thomas Zimmermann <tzimmermann@suse.de>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 drivers/gpu/drm/drm_debugfs.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index b0a826489488..0073854a4383 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -272,9 +272,6 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor)

 void drm_debugfs_cleanup(struct drm_minor *minor)
 {
-	if (!minor->debugfs_root)
-		return;
-
 	drm_debugfs_remove_all_files(minor);

 	debugfs_remove_recursive(minor->debugfs_root);
@@ -419,9 +416,6 @@ void drm_debugfs_connector_add(struct drm_connector *connector)
 	struct drm_minor *minor = connector->dev->primary;
 	struct dentry *root;

-	if (!minor->debugfs_root)
-		return;
-
 	root = debugfs_create_dir(connector->name, minor->debugfs_root);
 	connector->debugfs_entry = root;

@@ -440,9 +434,6 @@ void drm_debugfs_connector_add(struct drm_connector *connector)

 void drm_debugfs_connector_remove(struct drm_connector *connector)
 {
-	if (!connector->debugfs_entry)
-		return;
-
 	debugfs_remove_recursive(connector->debugfs_entry);

 	connector->debugfs_entry = NULL;
--
2.32.0


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

end of thread, other threads:[~2021-10-12  8:58 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 19:06 [PATCH 1/4] dri: do not check for NULL debugfs dentry Nirmoy Das
2021-10-11 19:06 ` [Intel-gfx] " Nirmoy Das
2021-10-11 19:06 ` [PATCH 2/4] drm/ttm: do not set NULL to " Nirmoy Das
2021-10-11 19:06   ` [Intel-gfx] " Nirmoy Das
2021-10-12  7:09   ` Christian König
2021-10-12  7:09     ` [Intel-gfx] " Christian König
2021-10-12  8:49     ` Das, Nirmoy
2021-10-12  8:49       ` [Intel-gfx] " Das, Nirmoy
2021-10-11 19:06 ` [PATCH 3/4] drm/i915/gt: do not check for NULL " Nirmoy Das
2021-10-11 19:06   ` [Intel-gfx] " Nirmoy Das
2021-10-11 19:06 ` [PATCH 4/4] vgaswitcheroo: " Nirmoy Das
2021-10-11 19:06   ` [Intel-gfx] " Nirmoy Das
2021-10-11 20:24   ` Lukas Wunner
2021-10-11 20:24     ` [Intel-gfx] " Lukas Wunner
2021-10-12  6:48     ` Lukas Wunner
2021-10-12  6:48       ` [Intel-gfx] " Lukas Wunner
2021-10-12  8:57       ` Das, Nirmoy
2021-10-12  8:57         ` Das, Nirmoy
2021-10-11 22:09 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/4] dri: " Patchwork
2021-10-11 22:40 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.