LKML Archive on
 help / color / Atom feed
From: Greg Kroah-Hartman <>
Cc: Greg Kroah-Hartman <>,
	Andrew Morton <>,
	Andrey Ryabinin <>,
	Mark Rutland <>,
	Arnd Bergmann <>,
	"Steven Rostedt (VMware)" <>,
	Dmitry Vyukov <>,
	Anders Roxell <>
Subject: [PATCH] kcov: no need to check return value of debugfs_create functions
Date: Tue, 22 Jan 2019 16:21:45 +0100
Message-ID: <> (raw)

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 <>
Cc: Andrey Ryabinin <>
Cc: Mark Rutland <>
Cc: Arnd Bergmann <>
Cc: "Steven Rostedt (VMware)" <>
Cc: Dmitry Vyukov <>
Cc: Anders Roxell <>
Signed-off-by: Greg Kroah-Hartman <>
 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;

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git
	git clone --mirror lkml/git/10.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone