staging: comedi: drivers: pcmuio: Merge if conditions
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>
Signed-off-by Amitoj Kaur Chawla <[email protected]>
---
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
@@ -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