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

Change generated with coccinelle.

To: Heiko Carstens <[email protected]>
To: Vasily Gorbik <[email protected]>
To: Alexander Gordeev <[email protected]>
To: Christian Borntraeger <[email protected]>
To: Sven Schnelle <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Philipp Hahn <[email protected]>
---
 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


Reply via email to