[PATCH v2 1/6] iio: introduce IIO_DECLARE_BUFFER_WITH_TS macros
Andy Shevchenko
andy.shevchenko at gmail.com
Wed Apr 23 08:43:35 PDT 2025
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.
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list