All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] timekeeping_debug: no need to check return value of debugfs_create functions
@ 2019-01-22 15:21 Greg Kroah-Hartman
  2019-01-29 19:12 ` [tip:timers/core] timekeeping/debug: No " tip-bot for Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-01-22 15:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, John Stultz, Thomas Gleixner, Stephen Boyd

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: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 kernel/time/timekeeping_debug.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/kernel/time/timekeeping_debug.c b/kernel/time/timekeeping_debug.c
index 86489950d690..b73e8850e58d 100644
--- a/kernel/time/timekeeping_debug.c
+++ b/kernel/time/timekeeping_debug.c
@@ -37,15 +37,8 @@ DEFINE_SHOW_ATTRIBUTE(tk_debug_sleep_time);
 
 static int __init tk_debug_sleep_time_init(void)
 {
-	struct dentry *d;
-
-	d = debugfs_create_file("sleep_time", 0444, NULL, NULL,
-		&tk_debug_sleep_time_fops);
-	if (!d) {
-		pr_err("Failed to create sleep_time debug file\n");
-		return -ENOMEM;
-	}
-
+	debugfs_create_file("sleep_time", 0444, NULL, NULL,
+			    &tk_debug_sleep_time_fops);
 	return 0;
 }
 late_initcall(tk_debug_sleep_time_init);
-- 
2.20.1


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

* [tip:timers/core] timekeeping/debug: No need to check return value of debugfs_create functions
  2019-01-22 15:21 [PATCH] timekeeping_debug: no need to check return value of debugfs_create functions Greg Kroah-Hartman
@ 2019-01-29 19:12 ` tip-bot for Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Greg Kroah-Hartman @ 2019-01-29 19:12 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, gregkh, sboyd, john.stultz, hpa, linux-kernel, mingo

Commit-ID:  ae503ab04913794b12e1939caa75aa091062a1b3
Gitweb:     https://git.kernel.org/tip/ae503ab04913794b12e1939caa75aa091062a1b3
Author:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
AuthorDate: Tue, 22 Jan 2019 16:21:42 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 29 Jan 2019 20:08:41 +0100

timekeeping/debug: No need to check return value of debugfs_create functions

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@linuxfoundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Link: https://lkml.kernel.org/r/20190122152151.16139-43-gregkh@linuxfoundation.org

---
 kernel/time/timekeeping_debug.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/kernel/time/timekeeping_debug.c b/kernel/time/timekeeping_debug.c
index 86489950d690..b73e8850e58d 100644
--- a/kernel/time/timekeeping_debug.c
+++ b/kernel/time/timekeeping_debug.c
@@ -37,15 +37,8 @@ DEFINE_SHOW_ATTRIBUTE(tk_debug_sleep_time);
 
 static int __init tk_debug_sleep_time_init(void)
 {
-	struct dentry *d;
-
-	d = debugfs_create_file("sleep_time", 0444, NULL, NULL,
-		&tk_debug_sleep_time_fops);
-	if (!d) {
-		pr_err("Failed to create sleep_time debug file\n");
-		return -ENOMEM;
-	}
-
+	debugfs_create_file("sleep_time", 0444, NULL, NULL,
+			    &tk_debug_sleep_time_fops);
 	return 0;
 }
 late_initcall(tk_debug_sleep_time_init);

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

end of thread, other threads:[~2019-01-29 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 15:21 [PATCH] timekeeping_debug: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-01-29 19:12 ` [tip:timers/core] timekeeping/debug: No " tip-bot for Greg Kroah-Hartman

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.