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.
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>
Reviewed-by: Ivan Vecera <ivecera@redhat.com>
Link: https://patch.msgid.link/20260519142710.1587324-2-u.kleine-koenig@baylibre.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
static const struct i2c_device_id zl3073x_i2c_id[] = {
- { "zl30731" },
- { "zl30732" },
- { "zl30733" },
- { "zl30734" },
- { "zl30735" },
+ { .name = "zl30731" },
+ { .name = "zl30732" },
+ { .name = "zl30733" },
+ { .name = "zl30734" },
+ { .name = "zl30735" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(i2c, zl3073x_i2c_id);