linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Luis R. Rodriguez" <lrodriguez@atheros.com>,
	Jouni Malinen <jmalinen@atheros.com>,
	Sujith Manoharan <Sujith.Manoharan@atheros.com>,
	Vasanthakumar Thiagarajan <vasanth@atheros.com>,
	Senthil Balasubramanian <senthilkumar@atheros.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	Felix Fietkau <nbd@openwrt.org>,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org
Subject: Re: [patch 3/9] ath9k: cleanup: u32 => bool
Date: Mon, 10 May 2010 16:46:26 +0200	[thread overview]
Message-ID: <20100510144625.GW27064@bicker> (raw)
In-Reply-To: <1273477106.3573.0.camel@jlt3.sipsolutions.net>

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

  reply	other threads:[~2010-05-10 14:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-08 16:22 [patch 3/9] ath9k: cleanup: u32 => bool Dan Carpenter
2010-05-10  7:38 ` Johannes Berg
2010-05-10 14:46   ` Dan Carpenter [this message]
2010-05-10 15:00     ` Pavel Roskin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100510144625.GW27064@bicker \
    --to=error27@gmail.com \
    --cc=Sujith.Manoharan@atheros.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=jmalinen@atheros.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lrodriguez@atheros.com \
    --cc=nbd@openwrt.org \
    --cc=senthilkumar@atheros.com \
    --cc=vasanth@atheros.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).