]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mlxsw: minimal: Use named initializers for struct i2c_device_id
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Tue, 19 May 2026 16:07:21 +0000 (18:07 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 May 2026 02:00:55 +0000 (19:00 -0700)
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 array, only its 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: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20260519160721.1597568-2-u.kleine-koenig@baylibre.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/minimal.c

index 512933dbab9a3e0169caee14f9f9ea2f3fbce61f..1fee57054b20f38463b07938dc9dbe8a74aff2db 100644 (file)
@@ -713,7 +713,7 @@ static struct mlxsw_driver mlxsw_m_driver = {
 };
 
 static const struct i2c_device_id mlxsw_m_i2c_id[] = {
-       { "mlxsw_minimal" },
+       { .name = "mlxsw_minimal" },
        { }
 };