From: Uwe Kleine-König (The Capable Hub) Date: Tue, 19 May 2026 16:04:20 +0000 (+0200) Subject: HID: i2c-hid-of: Use named initializers for struct i2c_device_id X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=eda0f9e5708786c1d0dfc582f3b127708dfbf835;p=thirdparty%2Flinux.git HID: i2c-hid-of: Use named initializers for struct i2c_device_id 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) Signed-off-by: Benjamin Tissoires --- diff --git a/drivers/hid/i2c-hid/i2c-hid-of.c b/drivers/hid/i2c-hid/i2c-hid-of.c index 57379b77e9778..59393d71ddb9d 100644 --- a/drivers/hid/i2c-hid/i2c-hid-of.c +++ b/drivers/hid/i2c-hid/i2c-hid-of.c @@ -144,8 +144,8 @@ MODULE_DEVICE_TABLE(of, i2c_hid_of_match); #endif static const struct i2c_device_id i2c_hid_of_id_table[] = { - { "hid" }, - { "hid-over-i2c" }, + { .name = "hid" }, + { .name = "hid-over-i2c" }, { } }; MODULE_DEVICE_TABLE(i2c, i2c_hid_of_id_table);