Skip to contentSkip to conversation

staging: lustre: obdclass: Use IS_ERR_OR_NULL

PATCH New Amitoj Kaur Chawla 1 participant 1 message Feb 13, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: obdclass: Use IS_ERR_OR_NULL

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>

---
 drivers/staging/lustre/lustre/obdclass/kernelcomm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/obdclass/kernelcomm.c +1 -1
index be4867c..8405ecc 100644
@@ -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) {
Signature · 1 line
1.9.1