All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 5/5] staging: comedi: drivers: pcmuio: Merge if conditions
@ 2016-02-11 14:39 Amitoj Kaur Chawla
  0 siblings, 0 replies; only message in thread
From: Amitoj Kaur Chawla @ 2016-02-11 14:39 UTC (permalink / raw)
  To: outreachy-kernel

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 <amitoj1606@gmail.com>
---
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(-)

diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c
index 7ea8130..d1d70fd 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -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++) {
-- 
1.9.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-11 14:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-11 14:39 [PATCH v3 5/5] staging: comedi: drivers: pcmuio: Merge if conditions Amitoj Kaur Chawla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.