staging: comedi: drivers: dt282x: Merge if conditions
PATCH v2 4/5 staging: comedi: drivers: dt282x: 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 v2:
-While merging use !x || !y instead of !(x && y)
drivers/staging/comedi/drivers/dt282x.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/comedi/drivers/dt282x.c +1 -4
@@ -887,10 +887,7 @@ static int dt282x_ao_inttrig(struct comedi_device *dev,if (trig_num != cmd->start_src)return -EINVAL ; -if (!dt282x_ao_setup_dma (dev, s,0 )) -return -EPIPE ; - -if (!dt282x_ao_setup_dma (dev, s,1 )) +if (!dt282x_ao_setup_dma (dev, s,0 ) || !dt282x_ao_setup_dma (dev, s,1 ))return -EPIPE ; outw(devpriv->supcsr | DT2821_SUPCSR_STRIG,
Signature · 1 line
1.9.1