Re: [PATCH v8 5/5] iio: magnetometer: ak8975: make use of the macros from bits.h
From: Jonathan Cameron
Date: Wed May 20 2026 - 11:44:14 EST
On Mon, 18 May 2026 09:50:29 +0200
Joshua Crofts via B4 Relay <devnull+joshua.crofts1.gmail.com@xxxxxxxxxx> wrote:
> From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> Make use of BIT() and GENMASK() where it makes sense.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
> Co-developed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
> Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
>
> @@ -858,7 +851,10 @@ static const struct iio_chan_spec ak8975_channels[] = {
> IIO_CHAN_SOFT_TIMESTAMP(AK8975_SCAN_TS),
> };
>
> -static const unsigned long ak8975_scan_masks[] = { 0x7, 0 };
> +static const unsigned long ak8975_scan_masks[] = {
> + BIT(AK8975_SCAN_X) | BIT(AK8975_SCAN_Y) | BIT(AK8975_SCAN_Z),
Ah. Here it is. Fair enough.
Maybe I'll remember it next time!
> + 0
> +};
>
> static const struct iio_info ak8975_info = {
> .read_raw = &ak8975_read_raw,
>