
8 May
2014
8 May
'14
10:31 a.m.
On 四, 2014-05-08 at 16:29 +0800, Axel Lin wrote:
Having the binary ones complement operator in the new bitmak value makes the code hard to read.
Signed-off-by: Axel Lin axel.lin@ingics.com
I think the binary ones complement operator in such use case is error prone: For example: To set BIT(1) and clear both BIT(2) and BIT(3): The following code has wrong result: regmap_update_bits(regmap, the_register, BIT(1), BIT(2), BIT(3), BIT(1) | ~BIT(2) | ~BIT(3));
Oops, I mean: regmap_update_bits(regmap, the_register, BIT(1) | BIT(2)| BIT(3), BIT(1) | ~BIT(2) | ~BIT(3)); Axel