[PATCH v2 1/6] iio: introduce IIO_DECLARE_BUFFER_WITH_TS macros
Andy Shevchenko
andy.shevchenko at gmail.com
Tue Apr 22 15:50:27 PDT 2025
On Wed, Apr 23, 2025 at 1:37 AM David Lechner <dlechner at baylibre.com> wrote:
> On 4/22/25 5:30 PM, Andy Shevchenko wrote:
> > On Wed, Apr 23, 2025 at 1:08 AM David Lechner <dlechner at baylibre.com> wrote:
...
> >> +_Static_assert(sizeof(IIO_DMA_MINALIGN) % sizeof(s64) == 0,
> >
> > Why not static_assert() ? Because of the message? But static_assert()
> > supports messages AFAICS.
> >
> >> + "macros above assume that IIO_DMA_MINALIGN also ensures s64 timestamp alignment");
>
> I just knew that was standard C. But I support BUILD_BUG_ON_MSG or static_assert
> would work just as well here.
In the kernel we use u8, for example, however in the standard it's
uint8_t :-) Same with many compiler attributes and wrappers on top of
the compiler things.
According to v6.14 codebase the only one driver uses _Static_assert()
for that (there are many in tools/ and more in BPF, with a few headers
where it's fine (esp. in UAPI where no static_assert() available).
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list