]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: Use aligned_s64 instead of open coding alignment.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 15 Dec 2024 18:29:04 +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.

Acked-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241215182912.481706-14-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
13 files changed:
drivers/iio/adc/ad4000.c
drivers/iio/adc/max1118.c
drivers/iio/adc/max11410.c
drivers/iio/adc/mcp3911.c
drivers/iio/adc/pac1921.c
drivers/iio/adc/rtq6056.c
drivers/iio/adc/ti-adc081c.c
drivers/iio/adc/ti-adc084s021.c
drivers/iio/adc/ti-ads1015.c
drivers/iio/adc/ti-ads1119.c
drivers/iio/adc/ti-ads131e08.c
drivers/iio/adc/ti-tsc2046.c
drivers/iio/adc/vf610_adc.c

index c6149a855af32aa3d7666ad521690b1542ad8937..1d556a842a68de1f2ae324a2b84ae0795933d026 100644 (file)
@@ -414,7 +414,7 @@ struct ad4000_state {
                        __be16 sample_buf16;
                        __be32 sample_buf32;
                } data;
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan __aligned(IIO_DMA_MINALIGN);
        u8 tx_buf[2];
        u8 rx_buf[2];
index 3d0a7d0eb7ee1ab1bdf6796dd8ba55f0091d4407..565ca2e21c0c23e02f191f03f4ac66666d727b3f 100644 (file)
@@ -39,7 +39,7 @@ struct max1118 {
        /* Ensure natural alignment of buffer elements */
        struct {
                u8 channels[2];
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } scan;
 
        u8 data __aligned(IIO_DMA_MINALIGN);
index f0dc4b460903163b2037cc3c49f740d8463e1cea..76abafd4740449f1c4a518be22a1a28e935b7667 100644 (file)
@@ -143,7 +143,7 @@ struct max11410_state {
        int irq;
        struct {
                u32 data __aligned(IIO_DMA_MINALIGN);
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } scan;
 };
 
index b097f04172c80b1d5d4e1dcbd785df45b36db2e7..6748b44d568db68120172a950bbfffb6adc7cfa3 100644 (file)
@@ -122,7 +122,7 @@ struct mcp3911 {
        const struct mcp3911_chip_info *chip;
        struct {
                u32 channels[MCP39XX_MAX_NUM_CHANNELS];
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } scan;
 
        u8 tx_buf __aligned(IIO_DMA_MINALIGN);
index 9f7b3d58549d5cdab24880a90b7a57a0554e7a90..90f61c47b1c46fb5a0fd4346345982aaa0a90972 100644 (file)
@@ -209,7 +209,7 @@ struct pac1921_priv {
 
        struct {
                u16 chan[PAC1921_NUM_MEAS_CHANS];
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan;
 };
 
index 56ed948a8ae10dc0ea79c524b1a942166f6a43f4..337bc8b31b2ce0153da372fcafaa67a1030b7db5 100644 (file)
@@ -634,7 +634,7 @@ static irqreturn_t rtq6056_buffer_trigger_handler(int irq, void *p)
        struct device *dev = priv->dev;
        struct {
                u16 vals[RTQ6056_MAX_CHANNEL];
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } data;
        unsigned int raw;
        int i = 0, bit, ret;
index 6c2cb3dabbbf0555f1ed51b52ee3f9eeca377a92..1af9be071d8deab3bcd8cae676008962bf875f07 100644 (file)
@@ -37,7 +37,7 @@ struct adc081c {
        /* Ensure natural alignment of buffer elements */
        struct {
                u16 channel;
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } scan;
 };
 
index bf98f9bf942a3fa510d668d1f9ff1ba362927c8d..da16876c32ae88493efed7f598ee8b2480dec0a5 100644 (file)
@@ -29,7 +29,7 @@ struct adc084s021 {
        /* Buffer used to align data */
        struct {
                __be16 channels[4];
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } scan;
        /*
         * DMA (thus cache coherency maintenance) may require the
index 47fe8e16aee42d375a74f9e97d4220542b04566d..4355726b373af5aa50b684b829816a1ecbd8035e 100644 (file)
@@ -448,7 +448,7 @@ static irqreturn_t ads1015_trigger_handler(int irq, void *p)
        /* Ensure natural alignment of timestamp */
        struct {
                s16 chan;
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan;
        int chan, ret, res;
 
index e9d9d4d46d3809c02bd9cf2e6874b16919d55d6e..0a68ecdea4e6f0084d2d0887015f679d2c944edc 100644 (file)
@@ -501,7 +501,7 @@ static irqreturn_t ads1119_trigger_handler(int irq, void *private)
        struct ads1119_state *st = iio_priv(indio_dev);
        struct {
                unsigned int sample;
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan;
        unsigned int index;
        int ret;
index 31f1f229d97a78ad9b3a7457ccfe42f34cdff94a..91a79ebc4bde2b3155b84d771b93cc455150c22d 100644 (file)
@@ -102,7 +102,7 @@ struct ads131e08_state {
        struct completion completion;
        struct {
                u8 data[ADS131E08_NUM_DATA_BYTES_MAX];
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } tmp_buf;
 
        u8 tx_buf[3] __aligned(IIO_DMA_MINALIGN);
index b56f2503f14ceb603192ef5eb34077482e84f858..7dde5713973f9d4848e5fa32e615baf88c3cda6a 100644 (file)
@@ -157,7 +157,7 @@ struct tsc2046_adc_priv {
                /* Scan data for each channel */
                u16 data[TI_TSC2046_MAX_CHAN];
                /* Timestamp */
-               s64 ts __aligned(8);
+               aligned_s64 ts;
        } scan_buf;
 
        /*
index 61bba39f7e93d4296866f0ae4aa79acdb01b024a..513365d42aa5b1c1650c0503ab01f98a33f60ae4 100644 (file)
@@ -173,7 +173,7 @@ struct vf610_adc {
        /* Ensure the timestamp is naturally aligned */
        struct {
                u16 chan;
-               s64 timestamp __aligned(8);
+               aligned_s64 timestamp;
        } scan;
 };