[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-fecb0d95cdf752836cafdfffc1661f61ba4e2101@git.kernel.org>
Date: Fri, 14 Jun 2019 05:58:12 -0700
From: tip-bot for Greg Kroah-Hartman <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: akpm@...ux-foundation.org, longman@...hat.com, tglx@...utronix.de,
cai@....us, joel@...lfernandes.org, zhongjiang@...wei.com,
linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
gregkh@...uxfoundation.org
Subject: [tip:core/debugobjects] debugobjects: No need to check return value
of debugfs_create()
Commit-ID: fecb0d95cdf752836cafdfffc1661f61ba4e2101
Gitweb: https://git.kernel.org/tip/fecb0d95cdf752836cafdfffc1661f61ba4e2101
Author: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
AuthorDate: Wed, 12 Jun 2019 17:35:13 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Fri, 14 Jun 2019 14:51:14 +0200
debugobjects: No need to check return value of debugfs_create()
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.
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Qian Cai <cai@....us>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Waiman Long <longman@...hat.com>
Cc: "Joel Fernandes (Google)" <joel@...lfernandes.org>
Cc: Zhong Jiang <zhongjiang@...wei.com>
Link: https://lkml.kernel.org/r/20190612153513.GA21082@kroah.com
---
lib/debugobjects.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 55437fd5128b..2ac42286cd08 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -850,26 +850,16 @@ static const struct file_operations debug_stats_fops = {
static int __init debug_objects_init_debugfs(void)
{
- struct dentry *dbgdir, *dbgstats;
+ struct dentry *dbgdir;
if (!debug_objects_enabled)
return 0;
dbgdir = debugfs_create_dir("debug_objects", NULL);
- if (!dbgdir)
- return -ENOMEM;
- dbgstats = debugfs_create_file("stats", 0444, dbgdir, NULL,
- &debug_stats_fops);
- if (!dbgstats)
- goto err;
+ debugfs_create_file("stats", 0444, dbgdir, NULL, &debug_stats_fops);
return 0;
-
-err:
- debugfs_remove(dbgdir);
-
- return -ENOMEM;
}
__initcall(debug_objects_init_debugfs);
Powered by blists - more mailing lists