Search Linux Wireless

Re: [PATCH] rfkill: properly assign a boolean type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


johannes


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux