From: Jonathan Cameron Date: Sun, 13 Apr 2025 10:34:24 +0000 (+0100) Subject: iio: adc: ad7266: Fix potential timestamp alignment issue. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=52d349884738c346961e153f195f4c7fe186fcf4;p=users%2Fjedix%2Flinux-maple.git iio: adc: ad7266: Fix potential timestamp alignment issue. On architectures where an s64 is only 32-bit aligned insufficient padding would be left between the earlier elements and the timestamp. Use aligned_s64 to enforce the correct placement and ensure the storage is large enough. Fixes: 54e018da3141 ("iio:ad7266: Mark transfer buffer as __be16") # aligned_s64 is much newer. Reported-by: David Lechner Reviewed-by: Nuno Sá Reviewed-by: David Lechner Link: https://patch.msgid.link/20250413103443.2420727-2-jic23@kernel.org Cc: Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c index 18559757f9085..7fef2727f89e9 100644 --- a/drivers/iio/adc/ad7266.c +++ b/drivers/iio/adc/ad7266.c @@ -45,7 +45,7 @@ struct ad7266_state { */ struct { __be16 sample[2]; - s64 timestamp; + aligned_s64 timestamp; } data __aligned(IIO_DMA_MINALIGN); };