[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMpxmJWPmhqadKcd6b62fScAs5N1TRtoXBq+5MPtC0Q=-p3ALg@mail.gmail.com>
Date: Fri, 20 Dec 2019 18:29:05 +0100
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Bartosz Golaszewski <brgl@...ev.pl>,
Kent Gibson <warthog618@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 12/13] gpiolib: add new ioctl() for monitoring changes
in line info
pt., 20 gru 2019 o 13:15 Andy Shevchenko <andy.shevchenko@...il.com> napisał(a):
>
> On Fri, Dec 20, 2019 at 12:25:59PM +0100, Bartosz Golaszewski wrote:
> > czw., 19 gru 2019 o 19:17 Andy Shevchenko <andy.shevchenko@...il.com>
> > napisał(a):
> > > On Thu, Dec 19, 2019 at 7:17 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> ...
>
> > > > +/**
> > > > + * struct gpioline_info_changed - Information about a change in status
> > > > + * of a GPIO line
> > > > + * @info: updated line information
> > > > + * @timestamp: estimate of time of status change occurrence, in nanoseconds
> > > > + * and GPIOLINE_CHANGED_CONFIG
> > > > + * @event_type: one of GPIOLINE_CHANGED_REQUESTED, GPIOLINE_CHANGED_RELEASED
> > > > + */
> > > > +struct gpioline_info_changed {
> > >
> > > > + struct gpioline_info info;
> > >
> > > Is this guaranteed to be always 8 byte aligned?
> > > I'm expecting to see some comments there and / or here about it.
> > >
> >
> > struct gpioline_info alone is 32-bit aligned but its size is 72 bytes
> > which works for 64-bit alignment. This new structure's biggest element
> > in 64-bit, so it's 64-bit aligned on 64-bit arch. We have 72 bytes of
> > gpioline_info, 8 bytes of timestamp, 32 bytes of event type and 5 * 32
> > bytes of padding. Should be fine, but I'll add comments to the header.
>
> Yes, what I meant is to add comment at least to struct gpioline_info definition
> that if somebody would like to change it there (which also might be a
> problematic here, if there is no versioning scheme / length member).
>
> > > > + __u64 timestamp;
> > > > + __u32 event_type;
> > > > + __u32 padding[5]; /* for future use */
> > > > +};
>
> Offtopic a bit, had you had a chance to look at Buildroot and our scripts
> I shared?
>
Not yet, I'll do that over the weekend.
Bart
Powered by blists - more mailing lists