Re: [PATCH] net: wimax: i2400m: control.c: Cleaning up conjunction always evaluates to false

2014-06-11 Thread David Miller
From: Rickard Strandqvist Date: Sat, 7 Jun 2014 13:26:37 +0200 > Logical conjunction always evaluates to false: minor < 2 && minor > 1 > I guess what you wanted is rather: minor > 2 || minor < 1 > > This was partly found using a static code analysis program called cppcheck. > > Signed-off-by:

Re: [PATCH] net: wimax: i2400m: control.c: Cleaning up conjunction always evaluates to false

2014-06-07 Thread Rickard Strandqvist
Hi Thought about it, and now it becomes clearer. But if someone decides to change the X or Y to a larger range than 1 and 2, it will not be correct ..? Or, will it not happen? But I'm no expert on this code :) I just wanted to point out the logical error. Best regards Rickard Strandqvist 2014

Re: [PATCH] net: wimax: i2400m: control.c: Cleaning up conjunction always evaluates to false

2014-06-07 Thread Joe Perches
On Sat, 2014-06-07 at 13:26 +0200, Rickard Strandqvist wrote: > Logical conjunction always evaluates to false: minor < 2 && minor > 1 > I guess what you wanted is rather: minor > 2 || minor < 1 [] > diff --git a/drivers/net/wimax/i2400m/control.c > b/drivers/net/wimax/i2400m/control.c [] > @@ -10

[PATCH] net: wimax: i2400m: control.c: Cleaning up conjunction always evaluates to false

2014-06-07 Thread Rickard Strandqvist
Logical conjunction always evaluates to false: minor < 2 && minor > 1 I guess what you wanted is rather: minor > 2 || minor < 1 This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/net/wimax/i2400m/control.c |2 +- 1 fil