[PATCH v2 1/6] iio: introduce IIO_DECLARE_BUFFER_WITH_TS macros

Nuno Sá noname.nuno at gmail.com
Thu Apr 24 00:44:36 PDT 2025


On Wed, 2025-04-23 at 18:43 +0300, Andy Shevchenko wrote:
> On Wed, Apr 23, 2025 at 5:51 PM David Lechner <dlechner at baylibre.com> wrote:
> > On 4/23/25 4:18 AM, Nuno Sá wrote:
> > > On Tue, 2025-04-22 at 17:07 -0500, David Lechner wrote:
> 
> ...
> 
> > > On the other hand, as I mentioned in V1, I think that an assertion or
> > > BUILD_BUG_ON_MSG for making sure 'count' is a compile time constant
> > > expression
> > > would be helpful. Sure, we'll get -Wvla but some developers might still
> > > ignore
> > > the warning and send patches with these arrays. So, it would be neater if
> > > we
> > > fail to build and force them to fix their code.
> 
> > BUILD_BUG_ON_MSG() won't work because it expands to a do/while loop which
> > won't
> > work in static struct declarations. But I can try to see if we can come up
> > with
> > something that works.
> 
> I guess Nuno is okay with static_assert() and TBH nowadays the
> BUILD_BUG() as is most likely historical.

Yes...

"...I think that an __assertion__ or BUILD_BUG_ON_MSG..."

- Nuno Sá



More information about the linux-arm-kernel mailing list