Re: [PATCH 1/2] add basic register-field manipulation macros

2016-06-13 Thread Felix Fietkau
On 2016-06-13 15:29, Jakub Kicinski wrote: > C bitfields are problematic and best avoided. Developers > interacting with hardware registers find themselves searching > for easy-to-use alternatives. Common approach is to define > structures or sets of macros containing mask and shift pair. >

[PATCH 1/2] add basic register-field manipulation macros

2016-06-13 Thread Jakub Kicinski
C bitfields are problematic and best avoided. Developers interacting with hardware registers find themselves searching for easy-to-use alternatives. Common approach is to define structures or sets of macros containing mask and shift pair. Operations on the register are then performed as follows: