Linux IIO development
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	David Lechner <dlechner@baylibre.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Eugen Hristev" <eugen.hristev@linaro.org>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/6] iio: introduce IIO_DECLARE_BUFFER_WITH_TS macros
Date: Thu, 24 Apr 2025 08:44:36 +0100	[thread overview]
Message-ID: <3f3906e76ef6d87a12552b99d8f5bf9e34724677.camel@gmail.com> (raw)
In-Reply-To: <CAHp75Vfa0spzCW8WmR32N7u55N89kxywK5uuYMZDJUNHwSZoDQ@mail.gmail.com>

On Wed, 2025-04-23 at 18:43 +0300, Andy Shevchenko wrote:
> On Wed, Apr 23, 2025 at 5:51 PM David Lechner <dlechner@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á

  reply	other threads:[~2025-04-24  7:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22 22:07 [PATCH v2 0/6] iio: introduce IIO_DECLARE_BUFFER_WITH_TS David Lechner
2025-04-22 22:07 ` [PATCH v2 1/6] iio: introduce IIO_DECLARE_BUFFER_WITH_TS macros David Lechner
2025-04-22 22:30   ` Andy Shevchenko
2025-04-22 22:37     ` David Lechner
2025-04-22 22:50       ` Andy Shevchenko
2025-04-23  9:18   ` Nuno Sá
2025-04-23 14:51     ` David Lechner
2025-04-23 15:43       ` Andy Shevchenko
2025-04-24  7:44         ` Nuno Sá [this message]
2025-04-26 11:19       ` Jonathan Cameron
2025-04-23 17:25   ` kernel test robot
2025-04-23 17:46   ` kernel test robot
2025-04-22 22:07 ` [PATCH v2 2/6] iio: adc: ad4695: use u16 for buffer elements David Lechner
2025-04-22 22:07 ` [PATCH v2 3/6] iio: adc: ad4695: use IIO_DECLARE_BUFFER_WITH_TS David Lechner
2025-04-22 22:34   ` Andy Shevchenko
2025-04-22 22:07 ` [PATCH v2 4/6] iio: adc: ad7380: " David Lechner
2025-04-22 22:33   ` Andy Shevchenko
2025-04-22 22:41     ` David Lechner
2025-04-22 22:53       ` Andy Shevchenko
2025-04-22 22:07 ` [PATCH v2 5/6] iio: accel: sca3300: " David Lechner
2025-04-22 22:07 ` [PATCH v2 6/6] iio: adc: at91-sama5d2: " David Lechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f3906e76ef6d87a12552b99d8f5bf9e34724677.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=dlechner@baylibre.com \
    --cc=eugen.hristev@linaro.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox