On Sat, 30 Nov 2024 10:18:09 +0100 Jakob Hauser <jahau@xxxxxxxxxxxxxx> wrote: > > --- a/drivers/iio/magnetometer/yamaha-yas530.c~drivers-iio-magnetometer-yamaha-yas530c-hack-around-build-error > > +++ a/drivers/iio/magnetometer/yamaha-yas530.c > > @@ -411,8 +411,10 @@ static int yas537_measure(struct yas5xx > > h[1] = (c->k * (c->a4 * s[0] + c->a5 * s[1] + c->a6 * s[2])) / BIT(13); > > h[2] = (c->k * (c->a7 * s[0] + c->a8 * s[1] + c->a9 * s[2])) / BIT(13); > > for (i = 0; i < 3; i++) { > > - clamp_val(h[i], -BIT(13), BIT(13) - 1); > > - xy1y2[i] = h[i] + BIT(13); > > + if (h[i] < (s32)-BIT(13)) > > + h[i] = (s32)-BIT(13); > > + if (h[i] > (s32)BIT(13) - 1) > > + h[i] = (s32)BIT(13) - 1; > > } > > } > > The line "xy1y2[i] = h[i] + BIT(13);" is missing now. oops, fixed. > > As this is just a temporary patch to avoid build errors, it might not > matter much. It's unlikely that the Yamaha YAS537 magnetometer comes in > use in that context. I assume the patch will disappear at some point. Yep.