On Fri, Mar 14, 2025 at 09:31:58AM +0200, Matti Vaittinen wrote: > On 13/03/2025 15:19, Andy Shevchenko wrote: > > On Thu, Mar 13, 2025 at 09:19:03AM +0200, Matti Vaittinen wrote: ... > > > +#define BD79124_MASK_HYSTERESIS GENMASK(3, 0) > > > +#define BD79124_LOW_LIMIT_MIN 0 > > > +#define BD79124_HIGH_LIMIT_MAX GENMASK(11, 0) > > > > These masks are not named after registers (or I don't see it clearly), > > Naming is hard. I usually try to make a balance between: > > 1) using names which explain the purpose when seen in the code (at call > site) > 2) keeping names short enough > 3) following the naming convention in the data sheet > 4) maintain relation to the register. > > I put most emphasis to the 1, while 2 is important to me as well. 3 is > _very_ nice to have, but it is often somehow contradicting with 1 and 2. 4 > is IMO just nice to have. The register is usually clearly visible at call > site, and if someone adds new functionality (or checks the correctness of > the masks/registers), then 3 is way more important. > > I am open to any concrete suggestions though.