Skip to contentSkip to conversation

Staging: fsl-mc: Use !x instead of x == NULL.

PATCH In review Sandhya Bankar 3 participants 3 messages Sep 16, 2016 – Sep 17, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: fsl-mc: Use !x instead of x == NULL.

Use !x instead of x == NULL.
This issue was found by checkpatch.

---
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-msi.c +2 -2
index cc19092..bc1ad1a 100755
@@ -50,7 +50,7 @@ static void fsl_mc_msi_update_dom_ops(struct msi_domain_info *info)
 	/*
 	 * set_desc should not be set by the caller
 	 */
-	if (ops->set_desc == NULL)
+	if (!ops->set_desc)
 		ops->set_desc = fsl_mc_msi_set_desc;
 }
 
@@ -140,7 +140,7 @@ static void fsl_mc_msi_update_chip_ops(struct msi_domain_info *info)
 	/*
 	 * irq_write_msi_msg should not be set by the caller
 	 */
-	if (chip->irq_write_msi_msg == NULL)
+	if (!chip->irq_write_msi_msg)
 		chip->irq_write_msi_msg = fsl_mc_msi_write_msg;
 }
 
Signature · 1 line
1.7.1
#1 lore raw
Quoted 2 lines · Sandhya Bankar

Use !x instead of x == NULL.
This issue was found by checkpatch.

You could do this with Coccinelle.

julia

Quoted 38 lines
---
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-msi.c +2 -3
index cc19092..bc1ad1a 100755
@@ -50,7 +50,7 @@ static void fsl_mc_msi_update_dom_ops(struct msi_domain_info *info)
 	/*
 	 * set_desc should not be set by the caller
 	 */
-	if (ops->set_desc == NULL)
+	if (!ops->set_desc)
 		ops->set_desc = fsl_mc_msi_set_desc;
 }
 
@@ -140,7 +140,7 @@ static void fsl_mc_msi_update_chip_ops(struct msi_domain_info *info)
 	/*
 	 * irq_write_msi_msg should not be set by the caller
 	 */
-	if (chip->irq_write_msi_msg == NULL)
+	if (!chip->irq_write_msi_msg)
 		chip->irq_write_msi_msg = fsl_mc_msi_write_msg;
 }
 
--

1.7.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160916093641.GA4100%40sandhya.
For more options, visit https://groups.google.com/d/optout.

maintainer
#2 lore raw
In reply to Sandhya Bankar

drivers/staging/fsl-mc/bus/fsl-mc-msi.c

Quoted 11 lines · Sandhya Bankar

Use !x instead of x == NULL.
This issue was found by checkpatch.

---
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-msi.c +0 -0
index cc19092..bc1ad1a 100755

Same permission here as well.