From: mohammed <mohammed@qca.qualcomm.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: <linville@tuxdriver.com>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] rfkill: properly assign a boolean type
Date: Fri, 16 Sep 2011 19:23:28 +0530 [thread overview]
Message-ID: <4E7354D8.40507@qca.qualcomm.com> (raw)
In-Reply-To: <1316180237.4130.37.camel@jlt3.sipsolutions.net>
On Friday 16 September 2011 07:07 PM, Johannes Berg wrote:
> On Fri, 2011-09-16 at 19:03 +0530, Mohammed Shafi Shajakhan wrote:
>> From: Mohammed Shafi Shajakhan<mohammed@qca.qualcomm.com>
>>
>> Signed-off-by: Mohammed Shafi Shajakhan<mohammed@qca.qualcomm.com>
>> ---
>> net/rfkill/core.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
>> index be90640..5be1957 100644
>> --- a/net/rfkill/core.c
>> +++ b/net/rfkill/core.c
>> @@ -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.
Hi johannes,
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!
>
> johannes
>
next prev parent reply other threads:[~2011-09-16 13:53 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 [this message]
2011-09-16 14:01 ` Johannes Berg
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=4E7354D8.40507@qca.qualcomm.com \
--to=mohammed@qca.qualcomm.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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).