Janitor-Question: use __set_bit instead of |=
wharms at bfs.de
Tue May 31 00:11:35 PDT 2011
Am 30.05.2011 23:23, schrieb Peter Hüwe:
> 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?
> - 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
> uses unsigned longs
> - standard C
> - let's the compiler decide
> - no warnings on chars, shorts, ints
Personaly i do not like it, but to be fair
|= must not be obvious but it depends on the situation.
It is std C and the compiler should handle it.
More information about the devel