]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: proximity: Use aligned_s64 instead of open coding alignment.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 15 Dec 2024 18:28:56 +0000 (18:28 +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-6-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/as3935.c
drivers/iio/proximity/hx9023s.c
drivers/iio/proximity/mb1232.c
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
drivers/iio/proximity/srf08.c
drivers/iio/proximity/sx_common.h

index 96fa97451cbf4aee88e490a9111f4c8e90ec4880..9d3caf2bef18d9bab32443e6ed12582f925ef64d 100644 (file)
@@ -63,7 +63,7 @@ struct as3935_state {
        /* Ensure timestamp is naturally aligned */
        struct {
                u8 chan;
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan;
        u8 buf[2] __aligned(IIO_DMA_MINALIGN);
 };
index d5b1522d3c19995a962687d987c06dbc388e2ce2..e092a935dbac7e7f2f8e30bc0e8220a0e9bddaa6 100644 (file)
@@ -146,7 +146,7 @@ struct hx9023s_data {
 
        struct {
                __le16 channels[HX9023S_CH_NUM];
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } buffer;
 
        /*
index 614e65cb9d428419dc310c28c3ab06809dcc5eed..cfc75d001f20e3186829ca5d0bcce462a5e1257d 100644 (file)
@@ -45,7 +45,7 @@ struct mb1232_data {
        /* Ensure correct alignment of data to push to IIO buffer */
        struct {
                s16 distance;
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } scan;
 };
 
index 5c959730aecd859daa9c9687942941ee89508dc4..f3d054b06b4c87949192837c09771d9219a41aad 100644 (file)
@@ -47,7 +47,7 @@ struct lidar_data {
        /* Ensure timestamp is naturally aligned */
        struct {
                u16 chan;
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan;
 };
 
index a75ea50428767cba22bc5306460674762aa5b9b1..86cab113ef3da5c123a4e04c2089ad81f580edb1 100644 (file)
@@ -66,7 +66,7 @@ struct srf08_data {
        /* Ensure timestamp is naturally aligned */
        struct {
                s16 chan;
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan;
 
        /* Sensor-Type */
index fb14e6f06a6de3485e0b817e4a069d5300ddfb6c..259b5c695233b4e295ad8ae2b05fceeaa4a7ae61 100644 (file)
@@ -125,7 +125,7 @@ struct sx_common_data {
        /* Ensure correct alignment of timestamp when present. */
        struct {
                __be16 channels[SX_COMMON_MAX_NUM_CHANNELS];
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } buffer;
 
        unsigned int suspend_ctrl;