Janitor-Question: use __set_bit instead of |=

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

 



Hi Janitors, staging-list

what is your opinion on using set_bit instead of using |= to set a bit?
Is it worth the effort to convert  existing |= to set_bit?

__set_bit
pro:
- often implemented in optimized assembly (e.g. for x86)
- intention might be clearer
- less error prone
- "they are the only portable way to set a specific bit"
according to  Robert Love's Linux Kernel Development third edition, p.183

cons:
uses unsigned longs


|=
pro:
- standard C
- let's the compiler decide
- no warnings on chars, shorts, ints


Thanks,
Peter



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


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux