From: Ian Ray <ian.ray@gehealthcare.com>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: David Heidelberg <david@ixit.cz>, Carl Lee <carl.lee@amd.com>,
Jakub Kicinski <kuba@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
Tomasz Unger <tomasz.unger@yahoo.pl>,
oe-linux-nfc@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 03/12] nfc: Initialize acpi_device_id arrays using member names
Date: Tue, 7 Jul 2026 20:12:29 +0300 [thread overview]
Message-ID: <ak0zfaTxM5Kn7X5j@zeus> (raw)
In-Reply-To: <5f60cd3e9831aac3995ed1a1b074ca1ae32e5286.1783091699.git.u.kleine-koenig@baylibre.com>
On Fri, Jul 03, 2026 at 05:46:17PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> 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
> acpi_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>
Nice clarity improvement.
Reviewed-by: Ian Ray <ian.ray@gehealthcare.com>
> ---
> drivers/nfc/fdp/i2c.c | 2 +-
> drivers/nfc/nxp-nci/i2c.c | 6 +++---
> drivers/nfc/pn544/i2c.c | 2 +-
> drivers/nfc/st-nci/i2c.c | 4 ++--
> drivers/nfc/st-nci/spi.c | 2 +-
> drivers/nfc/st21nfca/i2c.c | 2 +-
> 6 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
> index 9d589b388432..47f3838ac9d4 100644
> --- a/drivers/nfc/fdp/i2c.c
> +++ b/drivers/nfc/fdp/i2c.c
> @@ -349,7 +349,7 @@ static void fdp_nci_i2c_remove(struct i2c_client *client)
> }
>
> static const struct acpi_device_id fdp_nci_i2c_acpi_match[] = {
> - { "INT339A" },
> + { .id = "INT339A" },
> {}
> };
> MODULE_DEVICE_TABLE(acpi, fdp_nci_i2c_acpi_match);
> diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
> index faebc89a7ef5..39b43f8f3bf0 100644
> --- a/drivers/nfc/nxp-nci/i2c.c
> +++ b/drivers/nfc/nxp-nci/i2c.c
> @@ -362,9 +362,9 @@ MODULE_DEVICE_TABLE(of, of_nxp_nci_i2c_match);
>
> #ifdef CONFIG_ACPI
> static const struct acpi_device_id acpi_id[] = {
> - { "NXP1001" },
> - { "NXP1002" },
> - { "NXP7471" },
> + { .id = "NXP1001" },
> + { .id = "NXP1002" },
> + { .id = "NXP7471" },
> { }
> };
> MODULE_DEVICE_TABLE(acpi, acpi_id);
> diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
> index 66d070b18b4d..ccca07eb828c 100644
> --- a/drivers/nfc/pn544/i2c.c
> +++ b/drivers/nfc/pn544/i2c.c
> @@ -51,7 +51,7 @@ static const struct i2c_device_id pn544_hci_i2c_id_table[] = {
> MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table);
>
> static const struct acpi_device_id pn544_hci_i2c_acpi_match[] = {
> - { "NXP5440" },
> + { .id = "NXP5440" },
> {}
> };
> MODULE_DEVICE_TABLE(acpi, pn544_hci_i2c_acpi_match);
> diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
> index 4ddf0cc2a259..3906a806ec8b 100644
> --- a/drivers/nfc/st-nci/i2c.c
> +++ b/drivers/nfc/st-nci/i2c.c
> @@ -263,8 +263,8 @@ static const struct i2c_device_id st_nci_i2c_id_table[] = {
> MODULE_DEVICE_TABLE(i2c, st_nci_i2c_id_table);
>
> static const struct acpi_device_id st_nci_i2c_acpi_match[] = {
> - {"SMO2101"},
> - {"SMO2102"},
> + { .id = "SMO2101" },
> + { .id = "SMO2102" },
> {}
> };
> MODULE_DEVICE_TABLE(acpi, st_nci_i2c_acpi_match);
> diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
> index c94d67f33184..8fc60a972d98 100644
> --- a/drivers/nfc/st-nci/spi.c
> +++ b/drivers/nfc/st-nci/spi.c
> @@ -278,7 +278,7 @@ static struct spi_device_id st_nci_spi_id_table[] = {
> MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table);
>
> static const struct acpi_device_id st_nci_spi_acpi_match[] = {
> - { "SMO2101" },
> + { .id = "SMO2101" },
> {}
> };
> MODULE_DEVICE_TABLE(acpi, st_nci_spi_acpi_match);
> diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
> index d6cb74a89f93..e5109f701795 100644
> --- a/drivers/nfc/st21nfca/i2c.c
> +++ b/drivers/nfc/st21nfca/i2c.c
> @@ -578,7 +578,7 @@ static const struct i2c_device_id st21nfca_hci_i2c_id_table[] = {
> MODULE_DEVICE_TABLE(i2c, st21nfca_hci_i2c_id_table);
>
> static const struct acpi_device_id st21nfca_hci_i2c_acpi_match[] = {
> - { "SMO2100" },
> + { .id = "SMO2100" },
> {}
> };
> MODULE_DEVICE_TABLE(acpi, st21nfca_hci_i2c_acpi_match);
> --
> 2.55.0.11.g153666a7d9bb
>
next prev parent reply other threads:[~2026-07-07 17:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 15:46 [PATCH v1 00/12] nfc: Various cleanups around device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 01/12] nfc: Drop __maybe_unused from acpi_device_id tables Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 02/12] nfc: Drop unused assignment of acpi_device_id driver data Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 03/12] nfc: Initialize acpi_device_id arrays using member names Uwe Kleine-König (The Capable Hub)
2026-07-07 17:12 ` Ian Ray [this message]
2026-07-03 15:46 ` [PATCH v1 04/12] nfc: Unify style of acpi_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 05/12] nfc: pn544: Drop empty line between i2c_device_id array and MODULE_DEVICE_TABLE() Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 06/12] nfc: Initialize mei_cl_device_idarrays using member names Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 07/12] nfc: Drop __maybe_unused from of_device_id tables Uwe Kleine-König (The Capable Hub)
2026-07-07 17:28 ` Krzysztof Kozlowski
2026-07-08 5:05 ` Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 08/12] nfc: Unify style of of_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-07 17:13 ` Ian Ray
2026-07-03 15:46 ` [PATCH v1 09/12] nfc: Drop unused assignment of spi_device_id driver data Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 10/12] nfc: Initialize spi_device_idarrays using member names Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 11/12] nfc: Unify style of spi_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-03 15:46 ` [PATCH v1 12/12] nfc: Unify style of usb_device_id arrays Uwe Kleine-König (The Capable Hub)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ak0zfaTxM5Kn7X5j@zeus \
--to=ian.ray@gehealthcare.com \
--cc=carl.lee@amd.com \
--cc=david@ixit.cz \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
--cc=tomasz.unger@yahoo.pl \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox