Search Linux Wireless

Re: [RFC] bcma: add support for on-chip OTP memory used for SPROM storage

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

 



On 02/24/2012 11:58 AM, Johannes Berg wrote:
On Fri, 2012-02-24 at 11:39 +0100, Arend van Spriel wrote:
On 02/24/2012 08:52 AM, Rafał Miłecki wrote:
+               srom_control = bcma_read32(bus->drv_cc.core,
  +                                          BCMA_CC_SROM_CONTROL);
  +               return !!(srom_control&   BCMA_CC_SROM_CONTROL_PRESENT);
Does any compiler complain on returning sth like 0xF as a bool?


The compiler probably will not complain, but the caller could have
following:

if (bcma_sprom_ext_available(bus) == true) {
	return;
}
BUG();

I guess you would see the BUG show up in your log with the function
returning 0xF.

If it's really

bool foo = a&  b;

then the compiler has to compile that as if it was

u8 foo = !!(a&  b);

since bool can only carry the values 0 and 1.

So the !! isn't necessary.

johannes



I guess the compiler will convert the return value to _Bool (aka. bool) so indeed !! is not necessary. I will remove it.

Gr. AvS

--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux