]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
w1: ds2482: Use named initializers for arrays of i2c_device_data
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Thu, 4 Jun 2026 16:50:28 +0000 (18:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jun 2026 19:37:56 +0000 (21:37 +0200)
commit0560183f91773312aff9855997d27577e7b44729
treebae4cca741c6faef226744ad0cdd7f53b5b881bd
parent579f9786b7cd3b73eb99fe2c17c67bc03c1f14d8
w1: ds2482: Use named initializers for arrays of i2c_device_data

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.

The mentioned robustness is relevant for a planned change to struct
i2c_device_id that replaces .driver_data by an anonymous union.

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>
Link: https://patch.msgid.link/20260518171456.872736-2-u.kleine-koenig@baylibre.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://patch.msgid.link/20260604165027.83922-4-krzk@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/masters/ds2482.c