Re: [PATCH 2/7] iio: light: opt3001: use macros from bits.h header
From: Joshua Crofts
Date: Mon May 11 2026 - 07:10:57 EST
On Mon, 11 May 2026 at 13:01, Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
>
> On Mon, May 11, 2026 at 12:04:07PM +0200, Joshua Crofts via B4 Relay wrote:
>
> > Use GENMASK() and BIT() macros from bits.h header where it makes
> > sense. While at it, remove unused macro.
>
> ...
>
> > #define OPT3001_CONFIGURATION_M_SHUTDOWN (0 << 9)
> > -#define OPT3001_CONFIGURATION_M_SINGLE (1 << 9)
> > +#define OPT3001_CONFIGURATION_M_SINGLE BIT(9)
> > #define OPT3001_CONFIGURATION_M_CONTINUOUS (2 << 9) /* also 3 << 9 */
>
> No to this and similar changes. It's clear that this is a shifted plain value,
> it's not a bitfield. If in doubt, always consult with datasheet, if there is
> no such publicly available, ask driver author/maintainers of the subsystem.
Yeah, I knew this was a bit of a gamble, will fix in the next iteration.
--
Kind regards
CJD