diff mbox series

[2/8] iio: adc: mt6360-adc: use aligned_s64 for timestamp

Message ID 20250417-iio-more-timestamp-alignment-v1-2-eafac1e22318@baylibre.com (mailing list archive)
State New
Headers show
Series iio: more timestamp alignment | expand

Commit Message

David Lechner April 17, 2025, 4:52 p.m. UTC
Follow the pattern of other drivers and use aligned_s64 for the
timestamp. This will ensure that the timestamp is correctly aligned on
all architectures. It also ensures that the struct itself it also 8-byte
aligned so we can drop the explicit __aligned(8) attribute.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/adc/mt6360-adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Nuno Sá April 18, 2025, 8:57 a.m. UTC | #1
On Thu, 2025-04-17 at 11:52 -0500, David Lechner wrote:
> Follow the pattern of other drivers and use aligned_s64 for the
> timestamp. This will ensure that the timestamp is correctly aligned on
> all architectures. It also ensures that the struct itself it also 8-byte
> aligned so we can drop the explicit __aligned(8) attribute.
> 
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---

Reviewed-by: Nuno Sá <nuno.sa@analog.com>

>  drivers/iio/adc/mt6360-adc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c
> index
> 4eb2455d6ffacb8f09a404df4490b5a11e49660d..f8e98b6fa7e923c6b73bedf9ca1c466e7a9c3c47
> 100644
> --- a/drivers/iio/adc/mt6360-adc.c
> +++ b/drivers/iio/adc/mt6360-adc.c
> @@ -263,8 +263,8 @@ static irqreturn_t mt6360_adc_trigger_handler(int irq, void *p)
>  	struct mt6360_adc_data *mad = iio_priv(indio_dev);
>  	struct {
>  		u16 values[MT6360_CHAN_MAX];
> -		int64_t timestamp;
> -	} data __aligned(8);
> +		aligned_s64 timestamp;
> +	} data;
>  	int i = 0, bit, val, ret;
>  
>  	memset(&data, 0, sizeof(data));
>
Jonathan Cameron April 18, 2025, 2:45 p.m. UTC | #2
On Fri, 18 Apr 2025 09:57:09 +0100
Nuno Sá <noname.nuno@gmail.com> wrote:

> On Thu, 2025-04-17 at 11:52 -0500, David Lechner wrote:
> > Follow the pattern of other drivers and use aligned_s64 for the
> > timestamp. This will ensure that the timestamp is correctly aligned on
> > all architectures. It also ensures that the struct itself it also 8-byte
> > aligned so we can drop the explicit __aligned(8) attribute.
> > 
> > Signed-off-by: David Lechner <dlechner@baylibre.com>
> > ---  
> 
> Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Applied.
> 
> >  drivers/iio/adc/mt6360-adc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c
> > index
> > 4eb2455d6ffacb8f09a404df4490b5a11e49660d..f8e98b6fa7e923c6b73bedf9ca1c466e7a9c3c47
> > 100644
> > --- a/drivers/iio/adc/mt6360-adc.c
> > +++ b/drivers/iio/adc/mt6360-adc.c
> > @@ -263,8 +263,8 @@ static irqreturn_t mt6360_adc_trigger_handler(int irq, void *p)
> >  	struct mt6360_adc_data *mad = iio_priv(indio_dev);
> >  	struct {
> >  		u16 values[MT6360_CHAN_MAX];
> > -		int64_t timestamp;
> > -	} data __aligned(8);
> > +		aligned_s64 timestamp;
> > +	} data;
> >  	int i = 0, bit, val, ret;
> >  
> >  	memset(&data, 0, sizeof(data));
> >   
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c
index 4eb2455d6ffacb8f09a404df4490b5a11e49660d..f8e98b6fa7e923c6b73bedf9ca1c466e7a9c3c47 100644
--- a/drivers/iio/adc/mt6360-adc.c
+++ b/drivers/iio/adc/mt6360-adc.c
@@ -263,8 +263,8 @@  static irqreturn_t mt6360_adc_trigger_handler(int irq, void *p)
 	struct mt6360_adc_data *mad = iio_priv(indio_dev);
 	struct {
 		u16 values[MT6360_CHAN_MAX];
-		int64_t timestamp;
-	} data __aligned(8);
+		aligned_s64 timestamp;
+	} data;
 	int i = 0, bit, val, ret;
 
 	memset(&data, 0, sizeof(data));