| Date | Wed, 6 May 2026 18:12:16 +0100 | | From | Jonathan Cameron <> | | Subject | Re: [PATCH v5 18/18] iio: magnetometer: ak8975: make use of the macros from bits.h |
| |
On Tue, 05 May 2026 13:46:14 +0200 Joshua Crofts via B4 Relay <devnull+joshua.crofts1.gmail.com@kernel.org> wrote:
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > Make use of BIT() and GENMASK() where it makes sense. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Co-developed-by: Joshua Crofts <joshua.crofts1@gmail.com> > Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
One small thing in here. Feel free to just leave that for a separate patch and for now leave it as 0x7
> @@ -840,7 +833,7 @@ static const struct iio_chan_spec ak8975_channels[] = { > IIO_CHAN_SOFT_TIMESTAMP(3), > }; > > -static const unsigned long ak8975_scan_masks[] = { 0x7, 0 }; > +static const unsigned long ak8975_scan_masks[] = { GENMASK(2, 0), 0 }; Hmm. This is a fun one... It's actually 3 separate bits so please represent it as BIT(0) | BIT(1) | BIT(2)
or maybe add an enum for the channel scan indexes? BIT(SCAN_X) | BIT(SCAN_Y) | BIT(SCAN_Z) (and there will be an unused here SCAN_TIMESTAMP
> > static const struct iio_info ak8975_info = { > .read_raw = &ak8975_read_raw, >
|