[PATCH v1 2/2] ASoC: Use named initializers for arrays of i2c_device_data
Linus Walleij
linusw at kernel.org
Sat May 16 08:02:18 PDT 2026
On Wed, May 13, 2026 at 7:23 PM Uwe Kleine-König (The Capable Hub)
<u.kleine-koenig at 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.
>
> While touching all these arrays, unify indention and usage of commas.
>
> 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 at baylibre.com>
This is generally sound, so:
Reviewed-by: Linus Walleij <linusw at kernel.org>
Yours,
Linus Walleij
More information about the Linux-mediatek
mailing list