linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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:41:38 +0530	[thread overview]
Message-ID: <4E73591A.8070309@qca.qualcomm.com> (raw)
In-Reply-To: <1316182109.4130.39.camel@jlt3.sipsolutions.net>

On Friday 16 September 2011 07:38 PM, Johannes Berg wrote:
> On Fri, 2011-09-16 at 19:32 +0530, mohammed wrote:
>> On Friday 16 September 2011 07:31 PM, Johannes Berg wrote:
>>> 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 :)
>>
>> oh ok, thanks.
>
> Sure. I just wanted to clarify that it was to make the coder nicer, not
> to fix a bug or so.

no it does not fixes any bug :) thanks a lot for reviewing.

>
> johannes
>


  reply	other threads:[~2011-09-16 14:11 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
2011-09-16 14:02       ` mohammed
2011-09-16 14:08         ` Johannes Berg
2011-09-16 14:11           ` mohammed [this message]
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=4E73591A.8070309@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).