Re: [PATCH] regulator: axp20x: Get rid of AXP20X_xxx_START/END/STEPS defines

From: Olliver Schinagl
Date: Wed Feb 27 2019 - 14:41:53 EST

On 25-02-2019 18:25, Mark Brown wrote:
> On Sat, Feb 23, 2019 at 09:37:01PM +0100, Olliver Schinagl wrote:
>> In any case, you seem like a smart person that reads and writes hex and
>> bits often enough. This is not true for everyone. I can just as easily
>> reverse your arguments of course, for example, 'each field has a well
>> known meaning' ... to whom? People that use these things daily, sure.
>> People who just need to double check something or modify something, not
>> so much. They have to look up the MACRO, the struct its in, compare it
>> to others, so as you can see, what is natural for you, is not true for
>> everyone. :)
>> Also, the general consensus is still to avoid magic values, and to stay
>> consistent with the rest and not make expceptions, it makes sense to
>> have defines instead of magic values.
> If you find you need to describe what the fields are it would be much
> more constructive to add a comment at the top of the table saying what
> they are. As things are this isn't helping anyone - as a big pile of
> defines it's hard to read the values without context for how they're
> used and if you're looking at the table you can't tell what the
> regulator actually supports without going and decoding the defines.
Then the name of the define should be more constructive, which imo they
are reasonably? But as everything with programming, naming things is the
he hardest part, right?