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.
While touching these arrays, unify usage of whitespace in the list
terminator.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260519145722.1590298-2-u.kleine-koenig@baylibre.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/*-------------------------------------------------------------------------*/
static const struct i2c_device_id lan9303_i2c_id[] = {
- { "lan9303" },
+ { .name = "lan9303" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(i2c, lan9303_i2c_id);
}
static const struct i2c_device_id ksz9477_i2c_id[] = {
- { "ksz9477-switch" },
- {}
+ { .name = "ksz9477-switch" },
+ { }
};
MODULE_DEVICE_TABLE(i2c, ksz9477_i2c_id);
}
static const struct i2c_device_id xrs700x_i2c_id[] = {
- { "xrs700x-switch" },
- {}
+ { .name = "xrs700x-switch" },
+ { }
};
MODULE_DEVICE_TABLE(i2c, xrs700x_i2c_id);