staging: lustre: obdclass: Use IS_ERR_OR_NULL
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Sat, 13 Feb 2016 15:02:48 +0000 (20:32 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Feb 2016 00:21:15 +0000 (16:21 -0800)
Use macro IS_ERR_OR_NULL in place of tests for NULL and IS_ERR.

The Coccinelle semantic patch used to make the change is as follows:

//<smpl>
@@
expression e;
@@

- e == NULL || IS_ERR(e)
+ IS_ERR_OR_NULL(e)
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/kernelcomm.c

index be4867c5446c37b290fff22e04ceb7a011bf9aa3..8405eccdac1953c0a4c8deab130fcf301064ebe9 100644 (file)
@@ -59,7 +59,7 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload)
        mm_segment_t fs;
        int rc = -ENXIO;
 
-       if (!filp || IS_ERR(filp))
+       if (IS_ERR_OR_NULL(filp))
                return -EBADF;
 
        if (kuch->kuc_magic != KUC_MAGIC) {