2020-01-25 13:16:47

by Saurav Girepunje

[permalink] [raw]
Subject: [PATCH] staging: comedi: drivers: fix condition with no effect

fix warning reorted by coccicheck
WARNING: possible condition with no effect (if == else)

Signed-off-by: Saurav Girepunje <[email protected]>
---
drivers/staging/comedi/drivers/das1800.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c
index f16aa7e9..7ab72e8 100644
--- a/drivers/staging/comedi/drivers/das1800.c
+++ b/drivers/staging/comedi/drivers/das1800.c
@@ -1299,12 +1299,6 @@ static int das1800_attach(struct comedi_device *dev,
outb(DAC(i), dev->iobase + DAS1800_SELECT);
outw(0, dev->iobase + DAS1800_DAC);
}
- } else if (board->id == DAS1800_ID_AO) {
- /*
- * 'ao' boards have waveform analog outputs that are not
- * currently supported.
- */
- s->type = COMEDI_SUBD_UNUSED;
} else {
s->type = COMEDI_SUBD_UNUSED;
}
--
1.9.1


2020-01-27 08:51:47

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] staging: comedi: drivers: fix condition with no effect

On Sat, Jan 25, 2020 at 06:45:35PM +0530, Saurav Girepunje wrote:
> fix warning reorted by coccicheck
> WARNING: possible condition with no effect (if == else)
>
> Signed-off-by: Saurav Girepunje <[email protected]>
> ---
> drivers/staging/comedi/drivers/das1800.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c
> index f16aa7e9..7ab72e8 100644
> --- a/drivers/staging/comedi/drivers/das1800.c
> +++ b/drivers/staging/comedi/drivers/das1800.c
> @@ -1299,12 +1299,6 @@ static int das1800_attach(struct comedi_device *dev,
> outb(DAC(i), dev->iobase + DAS1800_SELECT);
> outw(0, dev->iobase + DAS1800_DAC);
> }
> - } else if (board->id == DAS1800_ID_AO) {
> - /*
> - * 'ao' boards have waveform analog outputs that are not
> - * currently supported.
> - */
> - s->type = COMEDI_SUBD_UNUSED;
> } else {
> s->type = COMEDI_SUBD_UNUSED;

This is for documentation. Just leave it as-is.

regards,
dan carpenter