[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190122152151.16139-46-gregkh@linuxfoundation.org>
Date: Tue, 22 Jan 2019 16:21:45 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Mark Rutland <mark.rutland@....com>,
Arnd Bergmann <arnd@...db.de>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
Anders Roxell <anders.roxell@...aro.org>
Subject: [PATCH] kcov: 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.
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrey Ryabinin <aryabinin@...tuozzo.com>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: "Steven Rostedt (VMware)" <rostedt@...dmis.org>
Cc: Dmitry Vyukov <dvyukov@...gle.com>
Cc: Anders Roxell <anders.roxell@...aro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
kernel/kcov.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/kcov.c b/kernel/kcov.c
index c2277dbdbfb1..5b0bb281c1a0 100644
--- a/kernel/kcov.c
+++ b/kernel/kcov.c
@@ -444,10 +444,8 @@ static int __init kcov_init(void)
* there is no need to protect it against removal races. The
* use of debugfs_create_file_unsafe() is actually safe here.
*/
- if (!debugfs_create_file_unsafe("kcov", 0600, NULL, NULL, &kcov_fops)) {
- pr_err("failed to create kcov in debugfs\n");
- return -ENOMEM;
- }
+ debugfs_create_file_unsafe("kcov", 0600, NULL, NULL, &kcov_fops);
+
return 0;
}
--
2.20.1
Powered by blists - more mailing lists