Re: [PATCH 00/10] mtd: use desginated initializers in *_device_id arrays
From: Uwe Kleine-König
Date: Wed Nov 25 2026 - 12:25:14 EST
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@xxxxxxxxxxxx
>
> Signed-off-by: Pawel Zalewski <pzalewski@xxxxxxxxxxxxxxxxxxxx>
Acked-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>
with or without addressing the nitpick I had for one of the patches.
Thanks for going through this
Uwe
Attachment:
signature.asc
Description: PGP signature