From: Johannes Berg <johannes@sipsolutions.net>
To: mohammed <mohammed@qca.qualcomm.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] rfkill: properly assign a boolean type
Date: Fri, 16 Sep 2011 16:01:19 +0200 [thread overview]
Message-ID: <1316181679.4130.38.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <4E7354D8.40507@qca.qualcomm.com>
On Fri, 2011-09-16 at 19:23 +0530, mohammed wrote:
> >> @@ -235,7 +235,7 @@ static bool __rfkill_set_hw_state(struct rfkill *rfkill,
> >> else
> >> rfkill->state&= ~RFKILL_BLOCK_HW;
> >> *change = prev != blocked;
> >> - any = rfkill->state& RFKILL_BLOCK_ANY;
> >> + any = !!(rfkill->state& RFKILL_BLOCK_ANY);
> >
> > I believe this is not necessary since "any" is a "bool" and as such
> > should cast correctly to 0/1.
> I agree the older one works perfectly fine. I stumbled upon this when i
> was trying to understand rfkill. but will not this change make it look
> better ? if it looks like a too trivial please drop it. Thanks!
Sure, whatever, I don't care; we can change it, but I think it'll
generate exactly the same code :)
johannes
next prev parent reply other threads:[~2011-09-16 14:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-16 13:33 [PATCH] rfkill: properly assign a boolean type Mohammed Shafi Shajakhan
2011-09-16 13:37 ` Johannes Berg
2011-09-16 13:53 ` mohammed
2011-09-16 14:01 ` Johannes Berg [this message]
2011-09-16 14:02 ` mohammed
2011-09-16 14:08 ` Johannes Berg
2011-09-16 14:11 ` mohammed
2011-09-16 14:26 ` mohammed
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=1316181679.4130.38.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mohammed@qca.qualcomm.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).