]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ipmi: Use named initializers for struct i2c_device_id
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Tue, 19 May 2026 15:01:56 +0000 (17:01 +0200)
committerCorey Minyard <corey@minyard.net>
Tue, 19 May 2026 17:32:40 +0000 (12:32 -0500)
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>
Message-ID: <20260519150156.1590826-2-u.kleine-koenig@baylibre.com>
Signed-off-by: Corey Minyard <corey@minyard.net>
drivers/char/ipmi/ipmb_dev_int.c
drivers/char/ipmi/ipmi_ipmb.c
drivers/char/ipmi/ipmi_ssif.c
drivers/char/ipmi/ssif_bmc.c

index 2fe1d205ce4e850cffaa688d65eaa77288068dd4..680ff15c30ab9a52968344d53e732350a7be2fa5 100644 (file)
@@ -353,8 +353,8 @@ static void ipmb_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id ipmb_id[] = {
-       { "ipmb-dev" },
-       {}
+       { .name = "ipmb-dev" },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, ipmb_id);
 
index 28818952a7a4bf814b95bdfb7046672ad4526cf2..1f1e5718f082e1c78237bb55dcc272b03185bf22 100644 (file)
@@ -566,8 +566,8 @@ MODULE_DEVICE_TABLE(of, of_ipmi_ipmb_match);
 #endif
 
 static const struct i2c_device_id ipmi_ipmb_id[] = {
-       { DEVICE_NAME },
-       {}
+       { .name = DEVICE_NAME },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, ipmi_ipmb_id);
 
index f419b46bf00207c59e81a9db9ded012f03106bf5..add043b812ea01d28777989e23f8f66d2eff43c8 100644 (file)
@@ -2094,7 +2094,7 @@ static int dmi_ipmi_probe(struct platform_device *pdev)
 #endif
 
 static const struct i2c_device_id ssif_id[] = {
-       { DEVICE_NAME },
+       { .name = DEVICE_NAME },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, ssif_id);
index 1df0e9284ad96b06a197406a295277620a4c7bfa..6036897725f3b0ea423833e9efbc9bf352f0a6c1 100644 (file)
@@ -874,7 +874,7 @@ static const struct of_device_id ssif_bmc_match[] = {
 MODULE_DEVICE_TABLE(of, ssif_bmc_match);
 
 static const struct i2c_device_id ssif_bmc_id[] = {
-       { DEVICE_NAME },
+       { .name = DEVICE_NAME },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, ssif_bmc_id);