Skip to contentSkip to conversation

staging: comedi: drivers: pcmuio: Merge if conditions

PATCH In review Amitoj Kaur Chawla 1 participant 1 message Feb 11, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 5/5 staging: comedi: drivers: pcmuio: Merge if conditions

Merge if conditions with the same statements.

Found using Coccinelle. The semantic patch used to find this is as follows:

//<smpl>
@@
statement S;
expression e,x;
@@

* if(e)
(
{ ... return ...; }
&
S
)

* if(x)
(
{ ... return ...; }
&
S
)
//</smpl>

---
Changes in v3:
-None
Changes in v2:

        -While merging use !x || !y instead of !(x && y)
 drivers/staging/comedi/drivers/pcmuio.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/comedi/drivers/pcmuio.c +1 -4
index 7ea8130..d1d70fd 100644
@@ -319,10 +319,7 @@ static void pcmuio_handle_intr_subdev(struct comedi_device *dev,
 
 	spin_lock_irqsave(&chip->spinlock, flags);
 
-	if (!chip->active)
-		goto done;
-
-	if (!(triggered & chip->enabled_mask))
+	if (!chip->active || !(triggered & chip->enabled_mask))
 		goto done;
 
 	for (i = 0; i < cmd->chanlist_len; i++) {
Signature · 1 line
1.9.1