Quoting Dan Carpenter <[email protected]>:

> Smatch complains we negate a non-boolean type here:
>
>                 if (!on != aniState->ofdmWeakSigDetectOff) {
>
> It's a quite common bug to forget that negation has higher precendence
> than compare operations.  In this case, it's clear from code that "on" is
> either 1 or 0 so smatch should not complain.

We could rename ofdmWeakSigDetectOff to ofdmWeakSigDetectOn and change  
the logic appropriately.  Positive logic is easier to understand in  
the long run.

ofdmWeakSigDetectOn could be boolean and "on" could be int, since it's  
an index.  The comparison could use !!on to convert int to boolean.

-- 
Regards,
Pavel Roskin
_______________________________________________
ath9k-devel mailing list
[email protected]
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

Reply via email to