mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
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:
parent
eb3176b741
commit
2cfb4cd058
|
@ -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];
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -143,7 +143,7 @@ struct max11410_state {
|
|||
int irq;
|
||||
struct {
|
||||
u32 data __aligned(IIO_DMA_MINALIGN);
|
||||
s64 ts __aligned(8);
|
||||
aligned_s64 ts;
|
||||
} scan;
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -209,7 +209,7 @@ struct pac1921_priv {
|
|||
|
||||
struct {
|
||||
u16 chan[PAC1921_NUM_MEAS_CHANS];
|
||||
s64 timestamp __aligned(8);
|
||||
aligned_s64 timestamp;
|
||||
} scan;
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -37,7 +37,7 @@ struct adc081c {
|
|||
/* Ensure natural alignment of buffer elements */
|
||||
struct {
|
||||
u16 channel;
|
||||
s64 ts __aligned(8);
|
||||
aligned_s64 ts;
|
||||
} scan;
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
/*
|
||||
|
|
|
@ -173,7 +173,7 @@ struct vf610_adc {
|
|||
/* Ensure the timestamp is naturally aligned */
|
||||
struct {
|
||||
u16 chan;
|
||||
s64 timestamp __aligned(8);
|
||||
aligned_s64 timestamp;
|
||||
} scan;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user