Search Linux Wireless

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

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

 



On Mon, May 10, 2010 at 09:38:26AM +0200, Johannes Berg wrote:
> On Sat, 2010-05-08 at 18:22 +0200, Dan Carpenter wrote:
> 
> > +		bool on = param ? 1 : 0;
> 
> umm, if you're going to use bool then use true/false too.
> 
> johannes

The 1 and 0 are used as array indexes so it looks funny to use true and
false.

Let's just drop this patch.  I wrote it to silence a smatch false 
positive but I should/will just fix smatch instead.

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.

regards,
dan carpenter
--
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