* [PATCH] Staging: comedi: driver: Remove condition with no effect
@ 2020-07-12 7:06 Saurav Girepunje
2020-07-13 13:34 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Saurav Girepunje @ 2020-07-12 7:06 UTC (permalink / raw)
To: abbotti, hsweeten, gregkh, saurav.girepunje, devel, linux-kernel
Cc: saurav.girepunje
Remove below warning in das1800.c
WARNING: possible condition with no effect (if == else)
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
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 f16aa7e9f4f3..7ab72e83d3d0 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;
}
--
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Staging: comedi: driver: Remove condition with no effect
2020-07-12 7:06 [PATCH] Staging: comedi: driver: Remove condition with no effect Saurav Girepunje
@ 2020-07-13 13:34 ` Greg KH
2020-07-13 13:41 ` Ian Abbott
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2020-07-13 13:34 UTC (permalink / raw)
To: Saurav Girepunje; +Cc: devel, abbotti, saurav.girepunje, linux-kernel
On Sun, Jul 12, 2020 at 12:36:28PM +0530, Saurav Girepunje wrote:
> Remove below warning in das1800.c
> WARNING: possible condition with no effect (if == else)
>
> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
> ---
> 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 f16aa7e9f4f3..7ab72e83d3d0 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;
What gave that warning? The comment should show you why this is good to
keep as-is, right?
thanks,
greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Staging: comedi: driver: Remove condition with no effect
2020-07-13 13:34 ` Greg KH
@ 2020-07-13 13:41 ` Ian Abbott
2020-07-18 17:23 ` SAURAV GIREPUNJE
0 siblings, 1 reply; 4+ messages in thread
From: Ian Abbott @ 2020-07-13 13:41 UTC (permalink / raw)
To: Greg KH, Saurav Girepunje; +Cc: devel, saurav.girepunje, linux-kernel
On 13/07/2020 14:34, Greg KH wrote:
> On Sun, Jul 12, 2020 at 12:36:28PM +0530, Saurav Girepunje wrote:
>> Remove below warning in das1800.c
>> WARNING: possible condition with no effect (if == else)
>>
>> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
>> ---
>> 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 f16aa7e9f4f3..7ab72e83d3d0 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;
>
> What gave that warning? The comment should show you why this is good to
> keep as-is, right?
One option is to move the comment into the '} else {' part that follows
this part.
--
-=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268. Registered address: )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Staging: comedi: driver: Remove condition with no effect
2020-07-13 13:41 ` Ian Abbott
@ 2020-07-18 17:23 ` SAURAV GIREPUNJE
0 siblings, 0 replies; 4+ messages in thread
From: SAURAV GIREPUNJE @ 2020-07-18 17:23 UTC (permalink / raw)
To: Ian Abbott, gregkh; +Cc: devel, saurav.girepunje, linux-kernel
On Mon, Jul 13, 2020 at 02:41:19PM +0100, Ian Abbott wrote:
> On 13/07/2020 14:34, Greg KH wrote:
> > On Sun, Jul 12, 2020 at 12:36:28PM +0530, Saurav Girepunje wrote:
> > > Remove below warning in das1800.c
> > > WARNING: possible condition with no effect (if == else)
> > >
> > > Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
> > > ---
> > > 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 f16aa7e9f4f3..7ab72e83d3d0 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;
> >
> > What gave that warning? The comment should show you why this is good to
> > keep as-is, right?
>
> One option is to move the comment into the '} else {' part that follows this
> part.
>
> --
> -=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
> -=( MEV Ltd. is a company registered in England & Wales. )=-
> -=( Registered number: 02862268. Registered address: )=-
> -=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
@gregkh : Got the warning using coccinelle.
@Ian: Yes, we can move comment to else part.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-18 17:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-12 7:06 [PATCH] Staging: comedi: driver: Remove condition with no effect Saurav Girepunje
2020-07-13 13:34 ` Greg KH
2020-07-13 13:41 ` Ian Abbott
2020-07-18 17:23 ` SAURAV GIREPUNJE
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).