From: Dan Carpenter Date: Mon, 10 May 2010 16:46:26 +0200 Subject: [ath9k-devel] [patch 3/9] ath9k: cleanup: u32 => bool In-Reply-To: <1273477106.3573.0.camel@jlt3.sipsolutions.net> References: <20100508162247.GO27064@bicker> <1273477106.3573.0.camel@jlt3.sipsolutions.net> Message-ID: <20100510144625.GW27064@bicker> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org 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