[PATCH v2] powerpc: add setmaskedbits macros

Timur Tabi timur at freescale.com
Fri Aug 17 03:45:55 EST 2007


Benjamin Herrenschmidt wrote:

>> The second example is actually a trick that lets me set some bits and clear 
>> others in one shot, so for the gumr_h register, all of the above values are 
>> single bits.  I guess that's not a good example.
> 
> Such tricks deserve at least a comment.

Would it be better if the function were called setclrbits_xxx(), and advertise 
that it can be used to set multi-bit fields *and* set and clear bits at the 
same time?

-- 
Timur Tabi
Linux Kernel Developer @ Freescale



More information about the Linuxppc-dev mailing list