]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: accel: adxl355: Make timestamp 64-bit aligned using aligned_s64
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Apr 2025 10:34:27 +0000 (11:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 May 2025 06:24:09 +0000 (08:24 +0200)
[ Upstream commit 1bb942287e05dc4c304a003ea85e6dd9a5e7db39 ]

The IIO ABI requires 64-bit aligned timestamps. In this case insufficient
padding would have been added on architectures where an s64 is only 32-bit
aligned.  Use aligned_s64 to enforce the correct alignment.

Fixes: 327a0eaf19d5 ("iio: accel: adxl355: Add triggered buffer support")
Reported-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250413103443.2420727-5-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/accel/adxl355_core.c

index 0c9225d18fb29bf176e3a100a1684850c9462a78..4973e8da5399d7b60373aadbf8c8b5e2dd363d97 100644 (file)
@@ -231,7 +231,7 @@ struct adxl355_data {
                u8 transf_buf[3];
                struct {
                        u8 buf[14];
-                       s64 ts;
+                       aligned_s64 ts;
                } buffer;
        } __aligned(IIO_DMA_MINALIGN);
 };