From: Yeqi Fu <asuk4.q@gmail.com>
To: rric@kernel.org, bp@alien8.de, tony.luck@intel.com
Cc: Yeqi Fu <asuk4.q@gmail.com>,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] edac: Fix error checking
Date: Thu, 18 May 2023 01:31:11 +0800 [thread overview]
Message-ID: <20230517173111.365787-1-asuk4.q@gmail.com> (raw)
The functions edac_debugfs_create_file return ERR_PTR if an error
occurs, and the appropriate way to verify for errors is to use the
inline function IS_ERR. The patch will substitute the null-comparison
with IS_ERR.
Signed-off-by: Yeqi Fu <asuk4.q@gmail.com>
---
drivers/edac/thunderx_edac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c
index 0bcd9f02c84a..b9c5772da959 100644
--- a/drivers/edac/thunderx_edac.c
+++ b/drivers/edac/thunderx_edac.c
@@ -481,7 +481,7 @@ static int thunderx_create_debugfs_nodes(struct dentry *parent,
ent = edac_debugfs_create_file(attrs[i]->name, attrs[i]->mode,
parent, data, &attrs[i]->fops);
- if (!ent)
+ if (IS_ERR(ent))
break;
}
--
2.37.2
reply other threads:[~2023-05-17 17:33 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=20230517173111.365787-1-asuk4.q@gmail.com \
--to=asuk4.q@gmail.com \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rric@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
all inboxes | Powered by JetHome®