public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-iio@vger.kernel.org, "Peter Rosin" <peda@axentia.se>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2] iio: iio-mux: use flexible array member
Date: Tue, 17 Mar 2026 09:26:24 +0200	[thread overview]
Message-ID: <abkCIJ-u7s3OVhfm@ashevche-desk.local> (raw)
In-Reply-To: <20260316232942.46641-1-rosenp@gmail.com>

On Mon, Mar 16, 2026 at 04:29:42PM -0700, Rosen Penev wrote:
> Make it clear that there's trailing data
> 
> Removes a pointer from the struct.
> 
> Use array_size for the sizeof calculations. Slightly cleaner.

array_size()
sizeof()

This commit message is poorly written. Please, consult with
https://chris.beams.io/git-commit on how to write better commit
messages.

...

> struct mux {

>  	struct iio_channel *parent;
>  	struct iio_chan_spec *chan;
>  	struct iio_chan_spec_ext_info *ext_info;
> -	struct mux_child *child;
>  	u32 delay_us;
> +	struct mux_child child[];
>  };

What's the point now to make it VLA? Again, why this and not the other one?

...

>  	mux = iio_priv(indio_dev);
> -	mux->child = (struct mux_child *)(mux + 1);
>  	mux->chan = (struct iio_chan_spec *)(mux->child + children);

(This piece linked to the above comment.)

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-17  7:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 23:29 [PATCHv2] iio: iio-mux: use flexible array member Rosen Penev
2026-03-17  7:26 ` Andy Shevchenko [this message]
2026-03-17 14:59   ` 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=abkCIJ-u7s3OVhfm@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=peda@axentia.se \
    --cc=rosenp@gmail.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