]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
iio: gyro: Use aligned_s64 instead of open coding alignment.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 15 Dec 2024 18:29:02 +0000 (18:29 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 28 Dec 2024 14:28:15 +0000 (14:28 +0000)
Use this new type to both slightly simplify the code and avoid
confusing static analysis tools. Mostly this series is about consistency
to avoid this code pattern getting copied into more drivers.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241215182912.481706-12-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/gyro/adxrs290.c
drivers/iio/gyro/bmg160_core.c
drivers/iio/gyro/itg3200_buffer.c
drivers/iio/gyro/mpu3050-core.c

index 600e9725da7882ce2f143217d0f94844d4e104a7..223fc181109c989fcfd965ef6acf15cb7ad762e6 100644 (file)
@@ -75,7 +75,7 @@ struct adxrs290_state {
        /* Ensure correct alignment of timestamp when present */
        struct {
                s16 channels[3];
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } buffer;
 };
 
index ba877d067afb7a7bd0d350edd8f2be86fe673c69..deb3c6459dde8b897cf47efb903f836e1eddf5cb 100644 (file)
@@ -99,7 +99,7 @@ struct bmg160_data {
        /* Ensure naturally aligned timestamp */
        struct {
                s16 chans[3];
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan;
        u32 dps_range;
        int ev_enable_state;
index 4cfa0d43956053e173686fa85ac708903396e50c..a624400a239cbe03d1f41e68c60f9f2efb411c07 100644 (file)
@@ -52,7 +52,7 @@ static irqreturn_t itg3200_trigger_handler(int irq, void *p)
         */
        struct {
                __be16 buf[ITG3200_SCAN_ELEMENTS];
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } scan;
 
        int ret = itg3200_read_all_channels(st->i2c, scan.buf);
index b6883e8b2a8b567aa13848e08e213007dfbca4c2..d66224bed8e3aba5f9805b837ab25ca7b74b5548 100644 (file)
@@ -474,7 +474,7 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p)
        int ret;
        struct {
                __be16 chans[4];
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan;
        s64 timestamp;
        unsigned int datums_from_fifo = 0;