iio: adc: Use aligned_s64 instead of open coding alignment.

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>
This commit is contained in:
Jonathan Cameron 2024-12-15 18:29:04 +00:00
parent eb3176b741
commit 2cfb4cd058
13 changed files with 13 additions and 13 deletions

View File

@ -414,7 +414,7 @@ struct ad4000_state {
__be16 sample_buf16; __be16 sample_buf16;
__be32 sample_buf32; __be32 sample_buf32;
} data; } data;
s64 timestamp __aligned(8); aligned_s64 timestamp;
} scan __aligned(IIO_DMA_MINALIGN); } scan __aligned(IIO_DMA_MINALIGN);
u8 tx_buf[2]; u8 tx_buf[2];
u8 rx_buf[2]; u8 rx_buf[2];

View File

@ -39,7 +39,7 @@ struct max1118 {
/* Ensure natural alignment of buffer elements */ /* Ensure natural alignment of buffer elements */
struct { struct {
u8 channels[2]; u8 channels[2];
s64 ts __aligned(8); aligned_s64 ts;
} scan; } scan;
u8 data __aligned(IIO_DMA_MINALIGN); u8 data __aligned(IIO_DMA_MINALIGN);

View File

@ -143,7 +143,7 @@ struct max11410_state {
int irq; int irq;
struct { struct {
u32 data __aligned(IIO_DMA_MINALIGN); u32 data __aligned(IIO_DMA_MINALIGN);
s64 ts __aligned(8); aligned_s64 ts;
} scan; } scan;
}; };

View File

@ -122,7 +122,7 @@ struct mcp3911 {
const struct mcp3911_chip_info *chip; const struct mcp3911_chip_info *chip;
struct { struct {
u32 channels[MCP39XX_MAX_NUM_CHANNELS]; u32 channels[MCP39XX_MAX_NUM_CHANNELS];
s64 ts __aligned(8); aligned_s64 ts;
} scan; } scan;
u8 tx_buf __aligned(IIO_DMA_MINALIGN); u8 tx_buf __aligned(IIO_DMA_MINALIGN);

View File

@ -209,7 +209,7 @@ struct pac1921_priv {
struct { struct {
u16 chan[PAC1921_NUM_MEAS_CHANS]; u16 chan[PAC1921_NUM_MEAS_CHANS];
s64 timestamp __aligned(8); aligned_s64 timestamp;
} scan; } scan;
}; };

View File

@ -634,7 +634,7 @@ static irqreturn_t rtq6056_buffer_trigger_handler(int irq, void *p)
struct device *dev = priv->dev; struct device *dev = priv->dev;
struct { struct {
u16 vals[RTQ6056_MAX_CHANNEL]; u16 vals[RTQ6056_MAX_CHANNEL];
s64 timestamp __aligned(8); aligned_s64 timestamp;
} data; } data;
unsigned int raw; unsigned int raw;
int i = 0, bit, ret; int i = 0, bit, ret;

View File

@ -37,7 +37,7 @@ struct adc081c {
/* Ensure natural alignment of buffer elements */ /* Ensure natural alignment of buffer elements */
struct { struct {
u16 channel; u16 channel;
s64 ts __aligned(8); aligned_s64 ts;
} scan; } scan;
}; };

View File

@ -29,7 +29,7 @@ struct adc084s021 {
/* Buffer used to align data */ /* Buffer used to align data */
struct { struct {
__be16 channels[4]; __be16 channels[4];
s64 ts __aligned(8); aligned_s64 ts;
} scan; } scan;
/* /*
* DMA (thus cache coherency maintenance) may require the * DMA (thus cache coherency maintenance) may require the

View File

@ -448,7 +448,7 @@ static irqreturn_t ads1015_trigger_handler(int irq, void *p)
/* Ensure natural alignment of timestamp */ /* Ensure natural alignment of timestamp */
struct { struct {
s16 chan; s16 chan;
s64 timestamp __aligned(8); aligned_s64 timestamp;
} scan; } scan;
int chan, ret, res; int chan, ret, res;

View File

@ -501,7 +501,7 @@ static irqreturn_t ads1119_trigger_handler(int irq, void *private)
struct ads1119_state *st = iio_priv(indio_dev); struct ads1119_state *st = iio_priv(indio_dev);
struct { struct {
unsigned int sample; unsigned int sample;
s64 timestamp __aligned(8); aligned_s64 timestamp;
} scan; } scan;
unsigned int index; unsigned int index;
int ret; int ret;

View File

@ -102,7 +102,7 @@ struct ads131e08_state {
struct completion completion; struct completion completion;
struct { struct {
u8 data[ADS131E08_NUM_DATA_BYTES_MAX]; u8 data[ADS131E08_NUM_DATA_BYTES_MAX];
s64 ts __aligned(8); aligned_s64 ts;
} tmp_buf; } tmp_buf;
u8 tx_buf[3] __aligned(IIO_DMA_MINALIGN); u8 tx_buf[3] __aligned(IIO_DMA_MINALIGN);

View File

@ -157,7 +157,7 @@ struct tsc2046_adc_priv {
/* Scan data for each channel */ /* Scan data for each channel */
u16 data[TI_TSC2046_MAX_CHAN]; u16 data[TI_TSC2046_MAX_CHAN];
/* Timestamp */ /* Timestamp */
s64 ts __aligned(8); aligned_s64 ts;
} scan_buf; } scan_buf;
/* /*

View File

@ -173,7 +173,7 @@ struct vf610_adc {
/* Ensure the timestamp is naturally aligned */ /* Ensure the timestamp is naturally aligned */
struct { struct {
u16 chan; u16 chan;
s64 timestamp __aligned(8); aligned_s64 timestamp;
} scan; } scan;
}; };