* [PATCH] mailbox: Use named initializers for acpi_device_id
@ 2026-10-15 12:58 Pawel Zalewski
2026-11-01 22:16 ` patchwork-bot+linux-riscv
0 siblings, 1 reply; 2+ messages in thread
From: Pawel Zalewski @ 2026-10-15 12:58 UTC (permalink / raw)
To: Jassi Brar, Rahul Pathak, Anup Patel, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti
Cc: linux-kernel, linux-riscv, Pawel Zalewski
Use a designated 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.
Unify the list terminator to have a single space between the brackets and
no trailing comma.
Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
---
This series is converting lists that contain the acpi_device_id struct,
which is defined in the include/linux/device-id/acpi.h to make 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 (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 to avoid triggering -Wmissing-braces. 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
(which is this series)
- actual implementations that make some of the modules use the new
driver_data_ptr member (does not apply to this tree)
That way the task can be fragmented into manageable and independent chunks
of work and makes this effort easier to review.
[1] https://lore.kernel.org/all/cover.1780048925.git.u.kleine-koenig@baylibre.com/
---
drivers/mailbox/mailbox-xgene-slimpro.c | 4 ++--
drivers/mailbox/riscv-sbi-mpxy-mbox.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mailbox/mailbox-xgene-slimpro.c b/drivers/mailbox/mailbox-xgene-slimpro.c
index 946ea773ec33..1f87a84e5995 100644
--- a/drivers/mailbox/mailbox-xgene-slimpro.c
+++ b/drivers/mailbox/mailbox-xgene-slimpro.c
@@ -228,8 +228,8 @@ MODULE_DEVICE_TABLE(of, slimpro_of_match);
#ifdef CONFIG_ACPI
static const struct acpi_device_id slimpro_acpi_ids[] = {
- {"APMC0D01", 0},
- {}
+ { .id = "APMC0D01" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, slimpro_acpi_ids);
#endif
diff --git a/drivers/mailbox/riscv-sbi-mpxy-mbox.c b/drivers/mailbox/riscv-sbi-mpxy-mbox.c
index ea69c6b6b4f9..4ebce35a8b6c 100644
--- a/drivers/mailbox/riscv-sbi-mpxy-mbox.c
+++ b/drivers/mailbox/riscv-sbi-mpxy-mbox.c
@@ -1006,8 +1006,8 @@ static const struct of_device_id mpxy_mbox_of_match[] = {
MODULE_DEVICE_TABLE(of, mpxy_mbox_of_match);
static const struct acpi_device_id mpxy_mbox_acpi_match[] = {
- { "RSCV0005" },
- {}
+ { .id = "RSCV0005" },
+ { }
};
MODULE_DEVICE_TABLE(acpi, mpxy_mbox_acpi_match);
---
base-commit: 0fcb05b72344f40806cbe810de8872f1698bf053
change-id: 20261015-acpi-mailbox-5c09b192119c
Best regards,
--
Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] mailbox: Use named initializers for acpi_device_id
2026-10-15 12:58 [PATCH] mailbox: Use named initializers for acpi_device_id Pawel Zalewski
@ 2026-11-01 22:16 ` patchwork-bot+linux-riscv
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-riscv @ 2026-11-01 22:16 UTC (permalink / raw)
To: Pawel Zalewski
Cc: linux-riscv, jassisinghbrar, rahul, anup, pjw, palmer, aou, alex,
linux-kernel
Hello:
This patch was applied to riscv/linux.git (fixes)
by Jassi Brar <jassisinghbrar@gmail.com>:
On Thu, 15 Oct 2026 13:58:28 +0100 you wrote:
> Use a designated 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.
>
> Unify the list terminator to have a single space between the brackets and
> no trailing comma.
>
> [...]
Here is the summary with links:
- mailbox: Use named initializers for acpi_device_id
https://git.kernel.org/riscv/c/01a40ad5a968
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-01 22:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-15 12:58 [PATCH] mailbox: Use named initializers for acpi_device_id Pawel Zalewski
2026-11-01 22:16 ` patchwork-bot+linux-riscv
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®