staging: comedi: drivers: dt282x: Merge if conditions
PATCH 5/6 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]>
--- 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
Greg KH
maintainerQuoted 36 lines · Amitoj Kaur Chawla
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]>--- drivers/staging/comedi/drivers/dt282x.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/staging/comedi/drivers/dt282x.c +0
-0
drivers/staging/comedi/drivers/dt282x.c static int dt282x_ao_inttrig(struct comedi_device *dev, · line 891
Quoted 9 lines
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 ;
Still not going to take this, sorry.
greg k-h