nouveau: no need to check return value of debugfs_create functions

Submitted by Greg KH on June 13, 2019, 11:58 a.m.

Details

Message ID 20190613115823.GD26335@kroah.com
State New
Headers show
Series "nouveau: no need to check return value of debugfs_create functions" ( rev: 1 ) in Nouveau

Not browsing as part of any series.

Commit Message

Greg KH June 13, 2019, 11:58 a.m.
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: Ben Skeggs <bskeggs@redhat.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/nouveau/nouveau_debugfs.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 7dfbbbc1beea..7b3ff55ac9a2 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -224,14 +224,10 @@  nouveau_drm_debugfs_init(struct drm_minor *minor)
 	struct dentry *dentry;
 	int i, ret;
 
-	for (i = 0; i < ARRAY_SIZE(nouveau_debugfs_files); i++) {
-		dentry = debugfs_create_file(nouveau_debugfs_files[i].name,
-					     S_IRUGO | S_IWUSR,
-					     minor->debugfs_root, minor->dev,
-					     nouveau_debugfs_files[i].fops);
-		if (!dentry)
-			return -ENOMEM;
-	}
+	for (i = 0; i < ARRAY_SIZE(nouveau_debugfs_files); i++)
+		debugfs_create_file(nouveau_debugfs_files[i].name,
+				    S_IRUGO | S_IWUSR, minor->debugfs_root,
+				    minor->dev, nouveau_debugfs_files[i].fops);
 
 	ret = drm_debugfs_create_files(nouveau_debugfs_list,
 				       NOUVEAU_DEBUGFS_ENTRIES,