From: Atul Kumar Pant <atulpant.linux@gmail.com>
To: josef@toxicpanda.com, axboe@kernel.dk
Cc: Atul Kumar Pant <atulpant.linux@gmail.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
nbd@other.debian.org, shuah@kernel.org
Subject: [PATCH v1] drivers: block: Drop unnecessary error check for debugfs_create_dir
Date: Wed, 16 Aug 2023 02:07:39 +0530 [thread overview]
Message-ID: <20230815203739.51706-1-atulpant.linux@gmail.com> (raw)
This patch removes the error checking for debugfs_create_dir.
Even if we get an error from this function, other debugfs APIs will
handle the error value and doesn't crash in that case. Hence caller can
safely ignore the errors that occur during the creation of debugfs nodes.
Signed-off-by: Atul Kumar Pant <atulpant.linux@gmail.com>
---
drivers/block/nbd.c | 7 -------
drivers/block/pktcdvd.c | 2 --
2 files changed, 9 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 65ecde3e2a5b..f64c79f6e112 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1666,11 +1666,6 @@ static int nbd_dev_dbg_init(struct nbd_device *nbd)
return -EIO;
dir = debugfs_create_dir(nbd_name(nbd), nbd_dbg_dir);
- if (IS_ERR(dir)) {
- dev_err(nbd_to_dev(nbd), "Failed to create debugfs dir for '%s'\n",
- nbd_name(nbd));
- return -EIO;
- }
config->dbg_dir = dir;
debugfs_create_file("tasks", 0444, dir, nbd, &nbd_dbg_tasks_fops);
@@ -1692,8 +1687,6 @@ static int nbd_dbg_init(void)
struct dentry *dbg_dir;
dbg_dir = debugfs_create_dir("nbd", NULL);
- if (IS_ERR(dbg_dir))
- return -EIO;
nbd_dbg_dir = dbg_dir;
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 69e5a100b3cf..37cdd68c3de5 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -451,8 +451,6 @@ static void pkt_debugfs_dev_new(struct pktcdvd_device *pd)
if (!pkt_debugfs_root)
return;
pd->dfs_d_root = debugfs_create_dir(pd->name, pkt_debugfs_root);
- if (IS_ERR(pd->dfs_d_root))
- return;
pd->dfs_f_info = debugfs_create_file("info", 0444,
pd->dfs_d_root, pd, &debug_fops);
--
2.25.1
reply other threads:[~2023-08-15 20:39 UTC|newest]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230815203739.51706-1-atulpant.linux@gmail.com \
--to=atulpant.linux@gmail.com \
--cc=axboe@kernel.dk \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nbd@other.debian.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).