2016-11-15 10:42:40

by David Binderman

[permalink] [raw]
Subject: drivers/bluetooth/dtl1_cs.c:559: bad if statement ?

Hello there,

drivers/bluetooth/dtl1_cs.c:559:32: warning: logical =91or=92 of collective=
ly exhaustive tests is always true [-Wlogical-op]

Source code is

if ((p_dev->resource[1]->end) || (p_dev->resource[1]->end < 8))
return -ENODEV;

Maybe better code

if ((p_dev->resource[1]->end < 0) || (p_dev->resource[1]->end >=3D 8))
return -ENODEV;

Regards

David Binderman


2016-11-22 21:55:54

by David Binderman

[permalink] [raw]
Subject: Re: drivers/bluetooth/dtl1_cs.c:559: bad if statement ?

Hello there,

>mind sending a patch?

Thanks for the offer, but I don't provide patches, I just find the bugs.
Folks who know the code are best placed to fix it, not me.

Regards

David Binderman

=

2016-11-22 21:49:38

by Marcel Holtmann

[permalink] [raw]
Subject: Re: drivers/bluetooth/dtl1_cs.c:559: bad if statement ?

Hi David,

> drivers/bluetooth/dtl1_cs.c:559:32: warning: logical ‘or’ of collectively exhaustive tests is always true [-Wlogical-op]
>
> Source code is
>
> if ((p_dev->resource[1]->end) || (p_dev->resource[1]->end < 8))
> return -ENODEV;
>
> Maybe better code
>
> if ((p_dev->resource[1]->end < 0) || (p_dev->resource[1]->end >= 8))
> return -ENODEV;

mind sending a patch?

Regards

Marcel