Search Linux Wireless

Re: [patch 3/9] ath9k: cleanup: u32 => bool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Dan Carpenter <error27@xxxxxxxxx>:

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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux