[PATCH 00/10] mtd: use desginated initializers in *_device_id arrays
Uwe Kleine-König
u.kleine-koenig at baylibre.com
Wed Nov 25 09:25:04 PST 2026
On Wed, Nov 25, 2026 at 04:28:26PM +0000, Pawel Zalewski wrote:
> This series is converting lists that contain the *_device_id structs,
> to make use of named initializers (which they do not use currently).
> This work is part of the on going effort in the kernel associated with
> device-ids [1]
>
> The plan is to convert *_device_id::driver_data to have an anonymous
> union, like it was introduced for PCI and I2C device ID tables.
Not sure I understand that. PCI and I2C wasn't converted yet. ieee1394
and zorro were.
> The goal is to increase type-safety (most of the existing casts are gone),
> to improve readability and to make use intent a bit more clear:
>
> ```
> union {
> kernel_ulong_t driver_data;
> const void *driver_data_ptr;
> }
> ```
>
> But for that to work all lists containing the structs need to use named
> initializers first to avoid triggering -Wmissing-braces for that field.
> This effort is split per every subsystem into:
> - pre-clean-ups that convert the lists to use named initializers
> (which is this series)
> - actual implementations that make some of the modules use the new
> driver_data_ptr member (which is not needed in the mtd subsystem)
>
> That way the task can be fragmented into manageable and independent chunks
> of work and makes this effort easier to review.
>
> Patches 1-3 implement the named initializer change.
> Patched 4-10 are just churn to unify the list termination and can be dropped.
>
> [1] https://lore.kernel.org/all/cover.1780048925.git.u.kleine-koenig@baylibre.com
>
> Signed-off-by: Pawel Zalewski <pzalewski at thegoodpenguin.co.uk>
Acked-by: Uwe Kleine-König <u.kleine-koenig at baylibre.com>
with or without addressing the nitpick I had for one of the patches.
Thanks for going through this
Uwe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20261125/f8489a36/attachment-0001.sig>
More information about the linux-mtd
mailing list