[PATCH 43/61] s390: Prefer IS_ERR_OR_NULL over manual NULL check

Philipp Hahn
2026-03-10T11:55:39Z

Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

To: Heiko Carstens <hca@linux.ibm.com>
To: Vasily Gorbik <gor@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>
To: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Sven Schnelle <svens@linux.ibm.com>
Cc: linux-s390@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
---
drivers/s390/char/tape_class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c
index b69430220a813e764ec1514c27ad486ac9e95575..aad4fff1faea69ae055b517910ec6467b14cb6e8 100644
--- a/drivers/s390/char/tape_class.c
+++ b/drivers/s390/char/tape_class.c
@@ -100,7 +100,7 @@ EXPORT_SYMBOL(register_tape_dev);

void unregister_tape_dev(struct device *device, struct tape_class_device *tcd)
{
- if (tcd != NULL && !IS_ERR(tcd)) {
+ if (!IS_ERR_OR_NULL(tcd)) {
sysfs_remove_link(&device->kobj, tcd->mode_name);
device_destroy(&tape_class, tcd->char_device->dev);
cdev_del(tcd->char_device);

--
2.43.0