From: Ruliang Lin <u202112092@hust.edu.cn>
To: Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
Ingo Molnar <mingo@kernel.org>
Cc: hust-os-kernel-patches@googlegroups.com,
Ruliang Lin <u202112092@hust.edu.cn>,
Dongliang Mu <dzm91@hust.edu.cn>, Borislav Petkov <bp@suse.de>,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drivers: ras: cec: return value check of `d`
Date: Sun, 23 Apr 2023 20:29:32 +0800 [thread overview]
Message-ID: <20230423122932.31274-1-u202112092@hust.edu.cn> (raw)
Smatch complains that:
create_debugfs_nodes() warn: 'd' is an error pointer or valid
According to the documentation of the debugfs_create_dir() function,
there is no need to check the return value of this function.
Just delete the dead code.
Fixes: 011d82611172 ("RAS: Add a Corrected Errors Collector")
Signed-off-by: Ruliang Lin <u202112092@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
drivers/ras/cec.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
index 321af498ee11..d2a03f94cbfe 100644
--- a/drivers/ras/cec.c
+++ b/drivers/ras/cec.c
@@ -483,10 +483,6 @@ static int __init create_debugfs_nodes(void)
struct dentry *d, *pfn, *decay, *count, *array;
d = debugfs_create_dir("cec", ras_debugfs_dir);
- if (!d) {
- pr_warn("Error creating cec debugfs node!\n");
- return -1;
- }
decay = debugfs_create_file("decay_interval", S_IRUSR | S_IWUSR, d,
&decay_interval, &decay_interval_ops);
--
2.25.1
next reply other threads:[~2023-04-23 12:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-23 12:29 Ruliang Lin [this message]
2023-04-23 12:56 ` [PATCH] drivers: ras: cec: return value check of `d` Borislav Petkov
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=20230423122932.31274-1-u202112092@hust.edu.cn \
--to=u202112092@hust.edu.cn \
--cc=bp@alien8.de \
--cc=bp@suse.de \
--cc=dzm91@hust.edu.cn \
--cc=hust-os-kernel-patches@googlegroups.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tony.luck@intel.com \
/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).