Hi Andrew,
On 30.11.24 07:45, Andrew Morton wrote:
The patch titled
Subject: drivers/iio/magnetometer/yamaha-yas530.c: hack around build error
has been added to the -mm mm-nonmm-unstable branch. Its filename is
drivers-iio-magnetometer-yamaha-yas530c-hack-around-build-error.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/drivers-iio-magnetometer-yamaha-yas530c-hack-around-build-error.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Subject: drivers/iio/magnetometer/yamaha-yas530.c: hack around build error
Date: Fri Nov 29 10:26:17 PM PST 2024
a temporary thing to avoid breaking people's builds
Cc: David Laight <David.Laight@xxxxxxxxxx>
Cc: Jakob Hauser <jahau@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
drivers/iio/magnetometer/yamaha-yas530.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- 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.
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.
_
Patches currently in -mm which might be from akpm@xxxxxxxxxxxxxxxxxxxx are
fs-proc-vmcorec-fix-warning-when-config_mmu=n.patch
mm-mempolicy-fix-migrate_to_node-assuming-there-is-at-least-one-vma-in-a-mm-fix.patch
mm-swap_cgroup-allocate-swap_cgroup-map-using-vcalloc-fix.patch
mm-page_alloc-add-some-detailed-comments-in-can_steal_fallback-fix.patch
drivers-iio-magnetometer-yamaha-yas530c-hack-around-build-error.patch
Kind regards,
Jakob