Skip to contentSkip to conversation

class: use IS_ERR_OR_NULL() helper in class_unregister()

PATCH Applied Yang Yingliang 3 participants 3 messages Aug 22, 2022 – Sep 9, 2022 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 class: use IS_ERR_OR_NULL() helper in class_unregister()

Use IS_ERR_OR_NULL() helper in class_unregister() to simplify code.

---
 drivers/base/class.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/class.c +1 -1
index 8feb85e186e3..64f7b9a0970f 100644
@@ -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);
Signature · 1 line
2.25.1
merge bot Applied
#1 lore raw
The following commit has been merged into the sched/psi branch of tip:

The following commit has been merged into the sched/psi branch of tip:

Commit-ID:     e9628e015fe205f10766f031f17e217f85650570
Gitweb:        https://git.kernel.org/tip/e9628e015fe205f10766f031f17e217f85650570
Author:        Yang Yingliang <[email protected]>
AuthorDate:    Mon, 22 Aug 2022 14:19:22 +08:00
Committer:     Greg Kroah-Hartman <[email protected]>
CommitterDate: Thu, 01 Sep 2022 18:15:40 +02:00

class: use IS_ERR_OR_NULL() helper in class_unregister()

Use IS_ERR_OR_NULL() helper in class_unregister() to simplify code.

---
 drivers/base/class.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/class.c +1 -1
index 8feb85e..64f7b9a 100644
@@ -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 lore raw
Quoted 25 lines · On Fri, Sep 09, 2022 at 02:00:22PM -0000, tip-bot2 for Yang Yingliang wrote:

The following commit has been merged into the sched/psi branch of tip:

Commit-ID:     e9628e015fe205f10766f031f17e217f85650570
Gitweb:        https://git.kernel.org/tip/e9628e015fe205f10766f031f17e217f85650570
Author:        Yang Yingliang <[email protected]>
AuthorDate:    Mon, 22 Aug 2022 14:19:22 +08:00
Committer:     Greg Kroah-Hartman <[email protected]>
CommitterDate: Thu, 01 Sep 2022 18:15:40 +02:00

class: use IS_ERR_OR_NULL() helper in class_unregister()

Use IS_ERR_OR_NULL() helper in class_unregister() to simplify code.

---
 drivers/base/class.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/class.c +0 -0
index 8feb85e..64f7b9a 100644

drivers/base/class.c EXPORT_SYMBOL_GPL(__class_create); · line 266

Quoted 8 lines
drivers/base/class.c +1 -1
@@ -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);

Any specific reason you pulled in my driver-core branch into tip?

confused,

greg k-h