[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHcu+VbxtAz-2y9FLdraqhYjzHKmi-5O=MioSU1caupT_y6PrQ@mail.gmail.com>
Date: Tue, 28 Jul 2020 15:26:09 -0600
From: Daniel Campello <campello@...gle.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: LKML <devicetree@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Jonathan Cameron <jic23@...nel.org>,
Douglas Anderson <dianders@...omium.org>,
Enrico Granata <egranata@...omium.org>,
Gwendal Grignou <gwendal@...omium.org>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
Stephen Boyd <swboyd@...omium.org>,
linux-iio <linux-iio@...r.kernel.org>
Subject: Re: [PATCH 06/15] iio: sx9310: Align memory
On Tue, Jul 28, 2020 at 12:11 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Tue, Jul 28, 2020 at 6:15 PM Daniel Campello <campello@...omium.org> wrote:
> >
> > Use __aligned(8) to ensure that the timestamp is correctly aligned
> > when we call push_to_buffers
> >
> > Signed-off-by: Daniel Campello <campello@...omium.org>
> > ---
> >
> > drivers/iio/proximity/sx9310.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/iio/proximity/sx9310.c b/drivers/iio/proximity/sx9310.c
> > index de52afd7c13333..fb5c16f2aa6b1a 100644
> > --- a/drivers/iio/proximity/sx9310.c
> > +++ b/drivers/iio/proximity/sx9310.c
> > @@ -131,8 +131,8 @@ struct sx9310_data {
> > */
> > bool prox_stat[SX9310_NUM_CHANNELS];
> > bool trigger_enabled;
> > - __be16 buffer[SX9310_NUM_CHANNELS +
> > - 4]; /* 64-bit data + 64-bit timestamp */
> > + /* 64-bit data + 64-bit timestamp buffer */
> > + __be16 buffer[SX9310_NUM_CHANNELS + 4] __aligned(8);
>
> If the data amount (channels) is always the same, please, use struct approach.
> Otherwise put a comment explaining dynamic data.
I'm not sure what you mean here. I have a comment above for the size
of the array.
>
> --
> With Best Regards,
> Andy Shevchenko
Powered by blists - more mailing lists