* [PATCH 0/4] char: use named initializers for acpi_device_id
@ 2026-08-07 11:26 Pawel Zalewski via B4 Relay
2026-08-07 11:26 ` [PATCH 1/4] " Pawel Zalewski via B4 Relay
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Pawel Zalewski via B4 Relay @ 2026-08-07 11:26 UTC (permalink / raw)
To: Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Mattia Dongili, Weili Qian, Olivia Mackall, Herbert Xu,
Corey Minyard, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe
Cc: linux-kernel, platform-driver-x86, linux-crypto,
openipmi-developer, linux-integrity,
Pawel Zalewski (The Capable Hub)
This series is converting lists that contain the acpi_device_id
struct, which is defined in the include/linux/device-id/acpi.h
to makes use of named initializers (which they do not use currently).
This work is part of the on going effort in the kernel associated
with device-ids [1]
The plan is to convert acpi_device_id::driver_data to have an anonymous
union, similarly to what was introduced for PCI and I2C device ID tables.
The goal is to increase type-safety (as most of the existing casts are gone),
to improve readability and to make use intent a bit more clear:
```
union {
kernel_ulong_t driver_data;
const void *driver_data_ptr;
}
```
But for that to work all lists containing the structs need to use named
initializers first. I already have patches that implement this and touching
a lot of kernel subsystmes that use the acpi_device_id struct and that list
keeps on growing. Therefore, I have decided to split the series per every
subsystem into:
- pre-clean-ups that convert the lists to use named initializers (this series)
- actual implementations that make some of the modules use the new driver_data_ptr
That way the task can be fragmented into manageable and independent
chunks of work and makes this effort easier to review.
Tested builds on a64 in Yocto using 7.2-rc6
Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
---
Pawel Zalewski (The Capable Hub) (4):
char: use named initializers for acpi_device_id
char: hw_random: use named initializers for acpi_device_id
char: ipmi: use named initializers for acpi_device_id
char: tpm: use named initializers for acpi_device_id
drivers/char/hpet.c | 4 ++--
drivers/char/hw_random/hisi-trng-v2.c | 2 +-
drivers/char/hw_random/xgene-rng.c | 2 +-
drivers/char/ipmi/ipmb_dev_int.c | 4 ++--
drivers/char/ipmi/ipmi_si_platform.c | 4 ++--
drivers/char/ipmi/ipmi_ssif.c | 4 ++--
drivers/char/sonypi.c | 4 ++--
drivers/char/tpm/st33zp24/i2c.c | 4 ++--
drivers/char/tpm/st33zp24/spi.c | 4 ++--
drivers/char/tpm/tpm_crb.c | 4 ++--
drivers/char/tpm/tpm_tis.c | 4 ++--
drivers/char/tpm/tpm_tis_i2c_cr50.c | 4 ++--
drivers/char/tpm/tpm_tis_spi_main.c | 4 ++--
drivers/char/tpm/tpm_tis_synquacer.c | 4 ++--
14 files changed, 26 insertions(+), 26 deletions(-)
---
base-commit: 848acc8ffe1b7cd5f1bf427b93069becfebc2c9d
change-id: 20260804-acpi-char-56316ab2bd03
Best regards,
--
Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/4] char: use named initializers for acpi_device_id
2026-08-07 11:26 [PATCH 0/4] char: use named initializers for acpi_device_id Pawel Zalewski via B4 Relay
@ 2026-08-07 11:26 ` Pawel Zalewski via B4 Relay
2026-08-07 12:26 ` Arnd Bergmann
2026-08-07 11:26 ` [PATCH 2/4] char: hw_random: " Pawel Zalewski via B4 Relay
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Pawel Zalewski via B4 Relay @ 2026-08-07 11:26 UTC (permalink / raw)
To: Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Mattia Dongili, Weili Qian, Olivia Mackall, Herbert Xu,
Corey Minyard, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe
Cc: linux-kernel, platform-driver-x86, linux-crypto,
openipmi-developer, linux-integrity,
Pawel Zalewski (The Capable Hub)
From: "Pawel Zalewski (The Capable Hub)" <pzalewski@thegoodpenguin.co.uk>
Use a named initializer for the acpi_device_id fields which
makes the code more readable and consistent with how lists
are initialized in the rest of the kernel code base. Also
drop explicitly setting fields to 0 where it is redundant.
While we are at it - unify the list terminator to have
a single space between the brackets and no trailing
comma.
Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
---
drivers/char/hpet.c | 4 ++--
drivers/char/sonypi.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 285c6037417a..88d0d4750a6b 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -1004,8 +1004,8 @@ static int hpet_acpi_probe(struct platform_device *pdev)
}
static const struct acpi_device_id hpet_device_ids[] = {
- {"PNP0103", 0},
- {"", 0},
+ { .id = "PNP0103" },
+ { }
};
static struct platform_driver hpet_acpi_driver = {
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 9309cfb935be..fb6357ba69dc 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1136,8 +1136,8 @@ static void sonypi_acpi_remove(struct platform_device *pdev)
}
static const struct acpi_device_id sonypi_device_ids[] = {
- {"SNY6001", 0},
- {"", 0},
+ { .id = "SNY6001" },
+ { }
};
static struct platform_driver sonypi_acpi_driver = {
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/4] char: hw_random: use named initializers for acpi_device_id
2026-08-07 11:26 [PATCH 0/4] char: use named initializers for acpi_device_id Pawel Zalewski via B4 Relay
2026-08-07 11:26 ` [PATCH 1/4] " Pawel Zalewski via B4 Relay
@ 2026-08-07 11:26 ` Pawel Zalewski via B4 Relay
2026-08-15 1:30 ` Herbert Xu
2026-08-07 11:26 ` [PATCH 3/4] char: ipmi: " Pawel Zalewski via B4 Relay
2026-08-07 11:26 ` [PATCH 4/4] char: tpm: " Pawel Zalewski via B4 Relay
3 siblings, 1 reply; 9+ messages in thread
From: Pawel Zalewski via B4 Relay @ 2026-08-07 11:26 UTC (permalink / raw)
To: Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Mattia Dongili, Weili Qian, Olivia Mackall, Herbert Xu,
Corey Minyard, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe
Cc: linux-kernel, platform-driver-x86, linux-crypto,
openipmi-developer, linux-integrity,
Pawel Zalewski (The Capable Hub)
From: "Pawel Zalewski (The Capable Hub)" <pzalewski@thegoodpenguin.co.uk>
Use a named initializer for the acpi_device_id fields which
makes the code more readable and consistent with how lists
are initialized in the rest of the kernel code base. Also
drop explicitly setting fields to 0 where it is redundant.
Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
---
drivers/char/hw_random/hisi-trng-v2.c | 2 +-
drivers/char/hw_random/xgene-rng.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/hw_random/hisi-trng-v2.c b/drivers/char/hw_random/hisi-trng-v2.c
index 6584ed051e09..9e0ecea56ad6 100644
--- a/drivers/char/hw_random/hisi-trng-v2.c
+++ b/drivers/char/hw_random/hisi-trng-v2.c
@@ -77,7 +77,7 @@ static int hisi_trng_probe(struct platform_device *pdev)
}
static const struct acpi_device_id hisi_trng_acpi_match[] = {
- { "HISI02B3", 0 },
+ { .id = "HISI02B3" },
{ }
};
MODULE_DEVICE_TABLE(acpi, hisi_trng_acpi_match);
diff --git a/drivers/char/hw_random/xgene-rng.c b/drivers/char/hw_random/xgene-rng.c
index 1f4b95341c2e..222db3fb275b 100644
--- a/drivers/char/hw_random/xgene-rng.c
+++ b/drivers/char/hw_random/xgene-rng.c
@@ -296,7 +296,7 @@ static int xgene_rng_init(struct hwrng *rng)
#ifdef CONFIG_ACPI
static const struct acpi_device_id xgene_rng_acpi_match[] = {
- { "APMC0D18", },
+ { .id = "APMC0D18" },
{ }
};
MODULE_DEVICE_TABLE(acpi, xgene_rng_acpi_match);
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/4] char: ipmi: use named initializers for acpi_device_id
2026-08-07 11:26 [PATCH 0/4] char: use named initializers for acpi_device_id Pawel Zalewski via B4 Relay
2026-08-07 11:26 ` [PATCH 1/4] " Pawel Zalewski via B4 Relay
2026-08-07 11:26 ` [PATCH 2/4] char: hw_random: " Pawel Zalewski via B4 Relay
@ 2026-08-07 11:26 ` Pawel Zalewski via B4 Relay
2026-08-07 11:40 ` Corey Minyard
2026-08-07 11:26 ` [PATCH 4/4] char: tpm: " Pawel Zalewski via B4 Relay
3 siblings, 1 reply; 9+ messages in thread
From: Pawel Zalewski via B4 Relay @ 2026-08-07 11:26 UTC (permalink / raw)
To: Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Mattia Dongili, Weili Qian, Olivia Mackall, Herbert Xu,
Corey Minyard, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe
Cc: linux-kernel, platform-driver-x86, linux-crypto,
openipmi-developer, linux-integrity,
Pawel Zalewski (The Capable Hub)
From: "Pawel Zalewski (The Capable Hub)" <pzalewski@thegoodpenguin.co.uk>
Use a named initializer for the acpi_device_id fields which
makes the code more readable and consistent with how lists
are initialized in the rest of the kernel code base. Also
drop explicitly setting fields to 0 where it is redundant.
While we are at it - unify the list terminator to have
a single space between the brackets and no trailing
comma.
Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
---
drivers/char/ipmi/ipmb_dev_int.c | 4 ++--
drivers/char/ipmi/ipmi_si_platform.c | 4 ++--
drivers/char/ipmi/ipmi_ssif.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c
index 680ff15c30ab..d576a77df927 100644
--- a/drivers/char/ipmi/ipmb_dev_int.c
+++ b/drivers/char/ipmi/ipmb_dev_int.c
@@ -360,8 +360,8 @@ MODULE_DEVICE_TABLE(i2c, ipmb_id);
#ifdef CONFIG_ACPI
static const struct acpi_device_id acpi_ipmb_id[] = {
- { "IPMB0001", 0 },
- {},
+ { .id = "IPMB0001" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, acpi_ipmb_id);
#endif
diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c
index bdc481ce1302..fa221cbb4b3b 100644
--- a/drivers/char/ipmi/ipmi_si_platform.c
+++ b/drivers/char/ipmi/ipmi_si_platform.c
@@ -387,8 +387,8 @@ static int acpi_ipmi_probe(struct platform_device *pdev)
}
static const struct acpi_device_id acpi_ipmi_match[] = {
- { "IPI0001", 0 },
- { },
+ { .id = "IPI0001" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, acpi_ipmi_match);
#else
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index 07f1d2327bb7..2361103c5edc 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -2057,8 +2057,8 @@ static unsigned short *ssif_address_list(void)
#ifdef CONFIG_ACPI
static const struct acpi_device_id ssif_acpi_match[] = {
- { "IPI0001", 0 },
- { },
+ { .id = "IPI0001" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, ssif_acpi_match);
#endif
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/4] char: tpm: use named initializers for acpi_device_id
2026-08-07 11:26 [PATCH 0/4] char: use named initializers for acpi_device_id Pawel Zalewski via B4 Relay
` (2 preceding siblings ...)
2026-08-07 11:26 ` [PATCH 3/4] char: ipmi: " Pawel Zalewski via B4 Relay
@ 2026-08-07 11:26 ` Pawel Zalewski via B4 Relay
3 siblings, 0 replies; 9+ messages in thread
From: Pawel Zalewski via B4 Relay @ 2026-08-07 11:26 UTC (permalink / raw)
To: Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Mattia Dongili, Weili Qian, Olivia Mackall, Herbert Xu,
Corey Minyard, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe
Cc: linux-kernel, platform-driver-x86, linux-crypto,
openipmi-developer, linux-integrity,
Pawel Zalewski (The Capable Hub)
From: "Pawel Zalewski (The Capable Hub)" <pzalewski@thegoodpenguin.co.uk>
Use a named initializer for the acpi_device_id fields which
makes the code more readable and consistent with how lists
are initialized in the rest of the kernel code base. Also
drop explicitly setting fields to 0 where it is redundant.
While we are at it - unify the list terminator to have
a single space between the brackets and no trailing
comma.
Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
---
drivers/char/tpm/st33zp24/i2c.c | 4 ++--
drivers/char/tpm/st33zp24/spi.c | 4 ++--
drivers/char/tpm/tpm_crb.c | 4 ++--
drivers/char/tpm/tpm_tis.c | 4 ++--
drivers/char/tpm/tpm_tis_i2c_cr50.c | 4 ++--
drivers/char/tpm/tpm_tis_spi_main.c | 4 ++--
drivers/char/tpm/tpm_tis_synquacer.c | 4 ++--
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c
index 81348487c125..d2bf9996760d 100644
--- a/drivers/char/tpm/st33zp24/i2c.c
+++ b/drivers/char/tpm/st33zp24/i2c.c
@@ -145,8 +145,8 @@ static const struct of_device_id of_st33zp24_i2c_match[] __maybe_unused = {
MODULE_DEVICE_TABLE(of, of_st33zp24_i2c_match);
static const struct acpi_device_id st33zp24_i2c_acpi_match[] __maybe_unused = {
- {"SMO3324"},
- {}
+ { .id = "SMO3324" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, st33zp24_i2c_acpi_match);
diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c
index 5149231f3de2..6671977c44aa 100644
--- a/drivers/char/tpm/st33zp24/spi.c
+++ b/drivers/char/tpm/st33zp24/spi.c
@@ -262,8 +262,8 @@ static const struct of_device_id of_st33zp24_spi_match[] __maybe_unused = {
MODULE_DEVICE_TABLE(of, of_st33zp24_spi_match);
static const struct acpi_device_id st33zp24_spi_acpi_match[] __maybe_unused = {
- {"SMO3324"},
- {}
+ { .id = "SMO3324" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, st33zp24_spi_acpi_match);
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index ceb4100ba400..671ba480a675 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -917,8 +917,8 @@ static const struct dev_pm_ops crb_pm = {
};
static const struct acpi_device_id crb_device_ids[] = {
- {"MSFT0101", 0},
- {"", 0},
+ { .id = "MSFT0101" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, crb_device_ids);
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 9aa230a63616..4bb18fb1df87 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -130,8 +130,8 @@ static inline int is_itpm(struct acpi_device *dev)
#define DEVICE_IS_TPM2 1
static const struct acpi_device_id tpm_acpi_tbl[] = {
- {"MSFT0101", DEVICE_IS_TPM2},
- {},
+ { .id = "MSFT0101", .driver_data = DEVICE_IS_TPM2 },
+ { }
};
MODULE_DEVICE_TABLE(acpi, tpm_acpi_tbl);
diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
index b48cacacc066..dc8a5ec5799b 100644
--- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
+++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
@@ -669,8 +669,8 @@ static const struct tpm_class_ops cr50_i2c = {
#ifdef CONFIG_ACPI
static const struct acpi_device_id cr50_i2c_acpi_id[] = {
- { "GOOG0005", 0 },
- {}
+ { .id = "GOOG0005" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, cr50_i2c_acpi_id);
#endif
diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
index 61b42c83ced8..d2e37e667dd7 100644
--- a/drivers/char/tpm/tpm_tis_spi_main.c
+++ b/drivers/char/tpm/tpm_tis_spi_main.c
@@ -339,8 +339,8 @@ static const struct of_device_id of_tis_spi_match[] __maybe_unused = {
MODULE_DEVICE_TABLE(of, of_tis_spi_match);
static const struct acpi_device_id acpi_tis_spi_match[] __maybe_unused = {
- {"SMO0768", 0},
- {}
+ { .id = "SMO0768" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, acpi_tis_spi_match);
diff --git a/drivers/char/tpm/tpm_tis_synquacer.c b/drivers/char/tpm/tpm_tis_synquacer.c
index 4927714d277a..c2d09315aa17 100644
--- a/drivers/char/tpm/tpm_tis_synquacer.c
+++ b/drivers/char/tpm/tpm_tis_synquacer.c
@@ -144,8 +144,8 @@ MODULE_DEVICE_TABLE(of, tis_synquacer_of_platform_match);
#ifdef CONFIG_ACPI
static const struct acpi_device_id tpm_synquacer_acpi_tbl[] = {
- { "SCX0009" },
- {},
+ { .id = "SCX0009" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, tpm_synquacer_acpi_tbl);
#endif
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/4] char: ipmi: use named initializers for acpi_device_id
2026-08-07 11:26 ` [PATCH 3/4] char: ipmi: " Pawel Zalewski via B4 Relay
@ 2026-08-07 11:40 ` Corey Minyard
0 siblings, 0 replies; 9+ messages in thread
From: Corey Minyard @ 2026-08-07 11:40 UTC (permalink / raw)
To: pzalewski
Cc: Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Mattia Dongili, Weili Qian, Olivia Mackall, Herbert Xu,
Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-kernel,
platform-driver-x86, linux-crypto, openipmi-developer,
linux-integrity
On Fri, Aug 07, 2026 at 12:26:10PM +0100, Pawel Zalewski via B4 Relay wrote:
> From: "Pawel Zalewski (The Capable Hub)" <pzalewski@thegoodpenguin.co.uk>
>
> Use a named initializer for the acpi_device_id fields which
> makes the code more readable and consistent with how lists
> are initialized in the rest of the kernel code base. Also
> drop explicitly setting fields to 0 where it is redundant.
>
> While we are at it - unify the list terminator to have
> a single space between the brackets and no trailing
> comma.
This is fine, it's in my next tree for next release.
Thank you,
-corey
>
> Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
> ---
> drivers/char/ipmi/ipmb_dev_int.c | 4 ++--
> drivers/char/ipmi/ipmi_si_platform.c | 4 ++--
> drivers/char/ipmi/ipmi_ssif.c | 4 ++--
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c
> index 680ff15c30ab..d576a77df927 100644
> --- a/drivers/char/ipmi/ipmb_dev_int.c
> +++ b/drivers/char/ipmi/ipmb_dev_int.c
> @@ -360,8 +360,8 @@ MODULE_DEVICE_TABLE(i2c, ipmb_id);
>
> #ifdef CONFIG_ACPI
> static const struct acpi_device_id acpi_ipmb_id[] = {
> - { "IPMB0001", 0 },
> - {},
> + { .id = "IPMB0001" },
> + { }
> };
> MODULE_DEVICE_TABLE(acpi, acpi_ipmb_id);
> #endif
> diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c
> index bdc481ce1302..fa221cbb4b3b 100644
> --- a/drivers/char/ipmi/ipmi_si_platform.c
> +++ b/drivers/char/ipmi/ipmi_si_platform.c
> @@ -387,8 +387,8 @@ static int acpi_ipmi_probe(struct platform_device *pdev)
> }
>
> static const struct acpi_device_id acpi_ipmi_match[] = {
> - { "IPI0001", 0 },
> - { },
> + { .id = "IPI0001" },
> + { }
> };
> MODULE_DEVICE_TABLE(acpi, acpi_ipmi_match);
> #else
> diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
> index 07f1d2327bb7..2361103c5edc 100644
> --- a/drivers/char/ipmi/ipmi_ssif.c
> +++ b/drivers/char/ipmi/ipmi_ssif.c
> @@ -2057,8 +2057,8 @@ static unsigned short *ssif_address_list(void)
>
> #ifdef CONFIG_ACPI
> static const struct acpi_device_id ssif_acpi_match[] = {
> - { "IPI0001", 0 },
> - { },
> + { .id = "IPI0001" },
> + { }
> };
> MODULE_DEVICE_TABLE(acpi, ssif_acpi_match);
> #endif
>
> --
> 2.55.0
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] char: use named initializers for acpi_device_id
2026-08-07 11:26 ` [PATCH 1/4] " Pawel Zalewski via B4 Relay
@ 2026-08-07 12:26 ` Arnd Bergmann
2026-09-03 7:15 ` Pawel Zalewski
0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2026-08-07 12:26 UTC (permalink / raw)
To: pzalewski, Clemens Ladisch, Greg Kroah-Hartman, Mattia Dongili,
Weili Qian, Olivia Mackall, Herbert Xu, Corey Minyard,
Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe
Cc: linux-kernel, platform-driver-x86, linux-crypto,
openipmi-developer, linux-integrity
On Fri, Aug 7, 2026, at 13:26, Pawel Zalewski via B4 Relay wrote:
> From: "Pawel Zalewski (The Capable Hub)" <pzalewski@thegoodpenguin.co.uk>
>
> Use a named initializer for the acpi_device_id fields which
> makes the code more readable and consistent with how lists
> are initialized in the rest of the kernel code base. Also
> drop explicitly setting fields to 0 where it is redundant.
>
> While we are at it - unify the list terminator to have
> a single space between the brackets and no trailing
> comma.
>
> Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
I don't think this is the right approach: I see around 1500 instances
of acpi_device_id data with plain initializers and only about 50
with named ones. Converting all of them seems like a lot of
extra work, and I'm fairly sure you can just change the
driver_data to an anonymous union without this.
Arnd
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/4] char: hw_random: use named initializers for acpi_device_id
2026-08-07 11:26 ` [PATCH 2/4] char: hw_random: " Pawel Zalewski via B4 Relay
@ 2026-08-15 1:30 ` Herbert Xu
0 siblings, 0 replies; 9+ messages in thread
From: Herbert Xu @ 2026-08-15 1:30 UTC (permalink / raw)
To: pzalewski
Cc: Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman,
Mattia Dongili, Weili Qian, Olivia Mackall, Corey Minyard,
Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-kernel,
platform-driver-x86, linux-crypto, openipmi-developer,
linux-integrity
On Fri, Aug 07, 2026 at 12:26:09PM +0100, Pawel Zalewski via B4 Relay wrote:
> From: "Pawel Zalewski (The Capable Hub)" <pzalewski@thegoodpenguin.co.uk>
>
> Use a named initializer for the acpi_device_id fields which
> makes the code more readable and consistent with how lists
> are initialized in the rest of the kernel code base. Also
> drop explicitly setting fields to 0 where it is redundant.
>
> Signed-off-by: Pawel Zalewski (The Capable Hub) <pzalewski@thegoodpenguin.co.uk>
> ---
> drivers/char/hw_random/hisi-trng-v2.c | 2 +-
> drivers/char/hw_random/xgene-rng.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] char: use named initializers for acpi_device_id
2026-08-07 12:26 ` Arnd Bergmann
@ 2026-09-03 7:15 ` Pawel Zalewski
0 siblings, 0 replies; 9+ messages in thread
From: Pawel Zalewski @ 2026-09-03 7:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Clemens Ladisch, Greg Kroah-Hartman, Mattia Dongili, Weili Qian,
Olivia Mackall, Herbert Xu, Corey Minyard, Peter Huewe,
Jarkko Sakkinen, Jason Gunthorpe, linux-kernel,
platform-driver-x86, linux-crypto, openipmi-developer,
linux-integrity
> I don't think this is the right approach: I see around 1500 instances
> of acpi_device_id data with plain initializers and only about 50
> with named ones. Converting all of them seems like a lot of
> extra work, and I'm fairly sure you can just change the
> driver_data to an anonymous union without this.
Sorry for the late reply, I was away.
You can change it to an anonymous union and the kernel modules can
build and then you can go over the code and set the designator only
for all of the entries that will make use of the driver_data_ptr field
(which is the union's second named member). However, you will still
get -Wmissing-braces in your build log for all other initializer
entries that still rely on positioning and resolve to the first union
member by default (the kernel_ulong_t). Adding an exception for this
warning seems like a bad practice. On x86_64 all warnings are promoted
to an actual hard build error via the defconfig. The other option is
to use more brackets instead of designated initializers for the items
that resolve to the kernel_ulong_t but that would arguably make the
code worse, inconsistent, less readable and require the same amount of
churn. Therefore, converting the tables first and using designated
initializers everywhere to begin with, before adding the union - as
proposed here - is the most sane and clean way forward, at least in my
opinion. Perhaps I should add this extra explanation and information
to the cover letters. Unless you meant something else.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-09-03 7:15 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-07 11:26 [PATCH 0/4] char: use named initializers for acpi_device_id Pawel Zalewski via B4 Relay
2026-08-07 11:26 ` [PATCH 1/4] " Pawel Zalewski via B4 Relay
2026-08-07 12:26 ` Arnd Bergmann
2026-09-03 7:15 ` Pawel Zalewski
2026-08-07 11:26 ` [PATCH 2/4] char: hw_random: " Pawel Zalewski via B4 Relay
2026-08-15 1:30 ` Herbert Xu
2026-08-07 11:26 ` [PATCH 3/4] char: ipmi: " Pawel Zalewski via B4 Relay
2026-08-07 11:40 ` Corey Minyard
2026-08-07 11:26 ` [PATCH 4/4] char: tpm: " Pawel Zalewski via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®