Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1501963

Re: drivers/mcb/mcb-parse.c:152: bad if expression

From Johannes Thumshirn <morbidrsa@gmail.com>
Newsgroups linux.kernel
Subject Re: drivers/mcb/mcb-parse.c:152: bad if expression
Date 2016-10-17 15:20 +0200
Message-ID <stfZD-3Xh-29@gated-at.bofh.it> (permalink)
References <stfZD-3Xh-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Oct 17, 2016 at 1:17 PM, David Binderman <dcb314@hotmail.com> wrote:
> Hello there,
>
> drivers/mcb/mcb-parse.c:152:22: warning: logical ‘and’ of mutually exclusive tests is always false [-Wlogical-op]
>
> Source code is
>
>        if (bar_count <= 0 && bar_count > CHAMELEON_BAR_MAX)
>
> Maybe better code
>
>        if (bar_count <= 0 || bar_count > CHAMELEON_BAR_MAX)
>
> Regards
>
> David Binderman

Hi David,

Looks reasonable, care to send a patch?

Thanks,
        Johannes

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: drivers/mcb/mcb-parse.c:152: bad if expression Johannes Thumshirn <morbidrsa@gmail.com> - 2016-10-17 15:20 +0200

csiph-web