From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>, <rafael@kernel.org>
Cc: <gregkh@linuxfoundation.org>
Subject: [PATCH -next] class: use IS_ERR_OR_NULL() helper in class_unregister()
Date: Mon, 22 Aug 2022 14:19:22 +0800 [thread overview]
Message-ID: <20220822061922.3884113-1-yangyingliang@huawei.com> (raw)
Use IS_ERR_OR_NULL() helper in class_unregister() to simplify code.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/base/class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 8feb85e186e3..64f7b9a0970f 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -260,7 +260,7 @@ EXPORT_SYMBOL_GPL(__class_create);
*/
void class_destroy(struct class *cls)
{
- if ((cls == NULL) || (IS_ERR(cls)))
+ if (IS_ERR_OR_NULL(cls))
return;
class_unregister(cls);
--
2.25.1
next reply other threads:[~2022-08-22 6:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 6:19 Yang Yingliang [this message]
2022-09-09 14:00 ` [tip: sched/psi] " tip-bot2 for Yang Yingliang
2022-09-09 18:08 ` Greg Kroah-Hartman
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=20220822061922.3884113-1-yangyingliang@huawei.com \
--to=yangyingliang@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@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
all inboxes | Powered by JetHome®