From: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Puranjay Mohan" <puranjay@kernel.org>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Ramona Gradinariu" <ramona.gradinariu@analog.com>,
"Petre Rodan" <petre.rodan@subdimension.ro>,
"Dan Robertson" <dan@dlrobertson.com>,
"Herve Codina" <herve.codina@bootlin.com>,
"Matti Vaittinen" <mazziesaccount@gmail.com>,
"Francesco Dolcini" <francesco@dolcini.it>,
"João Paulo Gonçalves" <jpaulo.silvagoncalves@gmail.com>,
"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"Anshul Dalal" <anshulusr@gmail.com>,
"Gustavo Silva" <gustavograzs@gmail.com>,
"Andreas Klinger" <ak@it-klinger.de>,
"Tomasz Duszynski" <tduszyns@gmail.com>,
"Ariana Lazar" <ariana.lazar@microchip.com>,
"Rui Miguel Silva" <rmfrfs@gmail.com>,
"Linus Walleij" <linusw@kernel.org>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
"Li peiyu" <579lpy@gmail.com>,
"Lorenzo Bianconi" <lorenzo@kernel.org>,
"Alex Lanzano" <lanzano.alex@gmail.com>,
"Jagath Jog J" <jagathjog1996@gmail.com>,
"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
"Remi Buisson" <remi.buisson@tdk.com>,
"Christian Eggers" <ceggers@arri.de>,
"Mudit Sharma" <muditsharma.info@gmail.com>,
"Kevin Tsai" <ktsai@capellamicro.com>,
"Ondřej Jirman" <megi@xff.cz>,
"Dixit Parmar" <dixitparmar19@gmail.com>,
"Gerald Loacker" <gerald.loacker@wolfvision.net>,
"Akhilesh Patil" <akhilesh@ee.iitb.ac.in>,
"Eddie James" <eajames@linux.ibm.com>,
"Petar Stoykov" <petar.stoykov@prodrive-technologies.com>,
"Song Qiang" <songqiang1304521@gmail.com>,
"Siratul Islam" <email@sirat.me>, "Crt Mori" <cmo@melexis.com>,
"Waqar Hameed" <waqar.hameed@axis.com>,
"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
"Gustavo Vaz" <gustavo.vaz@usp.br>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Marcus Folkesson" <marcus.folkesson@gmail.com>,
"Guenter Roeck" <linux@roeck-us.net>,
"Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>,
"Chuang Zhu" <git@chuang.cz>,
"Kyle Hsieh" <kylehsieh1995@gmail.com>,
"Giorgi Tchankvetadze" <giorgitchankvetadze1997@gmail.com>,
"Chen-Yu Tsai" <wens@kernel.org>,
"Oleksij Rempel" <o.rempel@pengutronix.de>,
"Romain Gantois" <romain.gantois@bootlin.com>,
"Sander Vanheule" <sander@svanheule.net>,
"David Jander" <david@protonic.nl>, "Andrew Davis" <afd@ti.com>,
chuguangqing <chuguangqing@inspur.com>,
"Shrikant Raskar" <raskar.shree97@gmail.com>,
"Kurt Borja" <kuurtb@gmail.com>,
"Denis Benato" <benato.denis96@gmail.com>,
"Ethan Tidmore" <ethantidmore06@gmail.com>,
"Tomas Borquez" <tomasborquez13@gmail.com>,
"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
"Shi Hao" <i.shihao.999@gmail.com>,
"Xichao Zhao" <zhao.xichao@vivo.com>,
"Erikas Bitovtas" <xerikasxx@gmail.com>,
"Aldo Conte" <aldocontelk@gmail.com>,
"Colin Ian King" <colin.i.king@gmail.com>,
"Gabriel Almeida" <gabrielsousa230@gmail.com>,
"Gabriela Victor" <gabevictor333@gmail.com>,
"Beatriz Viana Costa" <beatrizvianacosta16@gmail.com>,
"Frank Li" <Frank.Li@nxp.com>,
"Adrian Fluturel" <fluturel.adrian@gmail.com>,
"Antoni Pokusinski" <apokusinski01@gmail.com>,
"Yasin Lee" <yasin.lee.x@gmail.com>,
"Felix Gu" <ustc.gu@gmail.com>,
"Ben Collins" <bcollins@watter.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 7/7] iio: Initialize i2c_device_id arrays using member names
Date: Tue, 19 May 2026 21:51:20 +0200 [thread overview]
Message-ID: <agy7IA69oPEHl7mL@monoceros> (raw)
In-Reply-To: <20260519193913.6466630b@jic23-huawei>
[-- Attachment #1: Type: text/plain, Size: 2418 bytes --]
[Dropped one recipient who's email address isn't valid any more]
Hello Jonathan,
On Tue, May 19, 2026 at 07:39:13PM +0100, Jonathan Cameron wrote:
> On Tue, 19 May 2026 10:13:09 +0200
> Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> wrote:
>
> > While being less compact, using named initializers allows to more easily
> > see which members of the structs are assigned which value without having
> > to lookup the declaration of the struct. And it's also more robust
> > against changes to the struct definition.
> >
> > The mentioned robustness is relevant for a planned change to struct
> > i2c_device_id that replaces .driver_data by an anonymous union.
> >
> > This patch doesn't modify the compiled arrays, only their representation
> > in source form benefits. The former was confirmed with x86 and arm64
> > builds.
> >
> > Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
>
> I'd prefer it split into cases you care about (not just name) and the name only ones.
> That is unless I'm missing some potential change that breaks initializing
> just the first element and hence not the union you plan to add.
>
> It's a lot of churn and the name one isn't enabling anything new unless
> I'm missing something.
Today all hunks are about using named initializers to improve
readability, so the split into only .name vs. .name+.driver_data feels
very artificial to me. But if you think that's the compromise to use,
I'll adapt.
> We also get fixes in these annoyingly often so chances are this will mess
> up backports. Might even be worth splitting it up into directories
> just to reduce that backport mess.
In my opinion this is the reason to do this kind of cleanup with one
patch per driver. This doesn't only make backports easier, it also
allows to better record who reviewed and acked what, it reduces merge
conflicts (because if one driver is updated in your tree already since
my base, with one subsystem patch you get a merge conflict which makes
the whole patch unapplicable, with one patch per driver only one out of
(here) 208 fails).
But that isn't popular with most subsystem maintainers and so I went
with one patch per subsystem. 🤷
> Also, have you done a checkpatch check for this? Nice to not being fighting
> it for ever.
No, but that's on my agenda.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2026-05-19 19:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 8:13 [PATCH v2 0/7] iio: Rework i2c_device_id initialisation Uwe Kleine-König (The Capable Hub)
2026-05-19 8:13 ` [PATCH v2 1/7] iio: Drop unused driver_data in four i2c drivers Uwe Kleine-König (The Capable Hub)
2026-05-19 8:13 ` [PATCH v2 2/7] iio: accel: bmc150: Explicitly set .driver_data Uwe Kleine-König (The Capable Hub)
2026-05-19 18:42 ` Jonathan Cameron
2026-05-19 8:13 ` [PATCH v2 3/7] iio: adc: ad7091r5: Simplify driver_data handling Uwe Kleine-König (The Capable Hub)
2026-05-19 18:49 ` Jonathan Cameron
2026-05-19 8:13 ` [PATCH v2 4/7] iio: dac: max5821: Drop unused i2c driver data Uwe Kleine-König (The Capable Hub)
2026-05-19 19:06 ` Jonathan Cameron
2026-05-19 8:13 ` [PATCH v2 5/7] iio: proximity: sx9324: Drop unused " Uwe Kleine-König (The Capable Hub)
2026-05-19 19:08 ` Jonathan Cameron
2026-05-19 8:13 ` [PATCH v2 6/7] iio: proximity: sx9360: " Uwe Kleine-König (The Capable Hub)
2026-05-19 19:09 ` Jonathan Cameron
2026-05-19 8:13 ` [PATCH v2 7/7] iio: Initialize i2c_device_id arrays using member names Uwe Kleine-König (The Capable Hub)
2026-05-19 11:35 ` Matti Vaittinen
2026-05-19 15:46 ` Sirat
2026-05-19 18:39 ` Jonathan Cameron
2026-05-19 19:51 ` Uwe Kleine-König (The Capable Hub) [this message]
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=agy7IA69oPEHl7mL@monoceros \
--to=u.kleine-koenig@baylibre.com \
--cc=579lpy@gmail.com \
--cc=Frank.Li@nxp.com \
--cc=Michael.Hennerich@analog.com \
--cc=afd@ti.com \
--cc=ak@it-klinger.de \
--cc=akhilesh@ee.iitb.ac.in \
--cc=aldocontelk@gmail.com \
--cc=andy@kernel.org \
--cc=anshulusr@gmail.com \
--cc=antoniu.miclaus@analog.com \
--cc=apokusinski01@gmail.com \
--cc=ariana.lazar@microchip.com \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=bcollins@watter.com \
--cc=beatrizvianacosta16@gmail.com \
--cc=benato.denis96@gmail.com \
--cc=bigeasy@linutronix.de \
--cc=ceggers@arri.de \
--cc=chuguangqing@inspur.com \
--cc=cmo@melexis.com \
--cc=colin.i.king@gmail.com \
--cc=dan@dlrobertson.com \
--cc=david@protonic.nl \
--cc=dixitparmar19@gmail.com \
--cc=dlechner@baylibre.com \
--cc=eajames@linux.ibm.com \
--cc=email@sirat.me \
--cc=ethantidmore06@gmail.com \
--cc=fluturel.adrian@gmail.com \
--cc=francesco@dolcini.it \
--cc=gabevictor333@gmail.com \
--cc=gabrielsousa230@gmail.com \
--cc=gerald.loacker@wolfvision.net \
--cc=giorgitchankvetadze1997@gmail.com \
--cc=git@chuang.cz \
--cc=gustavo.vaz@usp.br \
--cc=gustavograzs@gmail.com \
--cc=herve.codina@bootlin.com \
--cc=hvilleneuve@dimonoff.com \
--cc=i.shihao.999@gmail.com \
--cc=jagathjog1996@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=jpaulo.silvagoncalves@gmail.com \
--cc=ktsai@capellamicro.com \
--cc=kuurtb@gmail.com \
--cc=kylehsieh1995@gmail.com \
--cc=lanzano.alex@gmail.com \
--cc=lars@metafoo.de \
--cc=linusw@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lorenzo@kernel.org \
--cc=marcelo.schmitt@analog.com \
--cc=marcus.folkesson@gmail.com \
--cc=mazziesaccount@gmail.com \
--cc=megi@xff.cz \
--cc=muditsharma.info@gmail.com \
--cc=nuno.sa@analog.com \
--cc=o.rempel@pengutronix.de \
--cc=petar.stoykov@prodrive-technologies.com \
--cc=petre.rodan@subdimension.ro \
--cc=puranjay@kernel.org \
--cc=ramona.gradinariu@analog.com \
--cc=raskar.shree97@gmail.com \
--cc=remi.buisson@tdk.com \
--cc=rmfrfs@gmail.com \
--cc=romain.gantois@bootlin.com \
--cc=sakari.ailus@linux.intel.com \
--cc=sander@svanheule.net \
--cc=songqiang1304521@gmail.com \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=tduszyns@gmail.com \
--cc=tomasborquez13@gmail.com \
--cc=ustc.gu@gmail.com \
--cc=waqar.hameed@axis.com \
--cc=wens@kernel.org \
--cc=xerikasxx@gmail.com \
--cc=yasin.lee.x@gmail.com \
--cc=zhao.xichao@vivo.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