* [PATCH] tty: serial: pl011: remove incorrect of_match_ptr annotation
@ 2025-02-25 16:35 Arnd Bergmann
0 siblings, 0 replies; only message in thread
From: Arnd Bergmann @ 2025-02-25 16:35 UTC (permalink / raw)
To: Russell King, Greg Kroah-Hartman, Jiri Slaby, Jacky Huang,
Shan-Chun Hung
Cc: Arnd Bergmann, Petr Mladek, Lino Sanfilippo, linux-kernel,
linux-serial, linux-arm-kernel
From: Arnd Bergmann <arnd@arndb.de>
Building with W=1 shows a warning about sbsa_uart_of_match being unused when
CONFIG_OF is disabled:
drivers/tty/serial/amba-pl011.c:2945:34: error: unused variable 'sbsa_uart_of_match' [-Werror,-Wunused-const-variable]
The driver is not actually used on any machines that are built
with CONFIG_OF disabled, so using of_match_ptr() won't save any
actual memory, and it can be best removed.
The corresponding ACPI_PTR() annotation does save a few bytes on
32-bit arm since CONFIG_ACPI is not available, but for consistency
it seems better to remove both along with the __maybe_unused
annotation on the ACPI table.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/amba-pl011.c | 6 +++---
drivers/tty/serial/ma35d1_serial.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 04212c823a91..e3b8590bc880 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -3001,7 +3001,7 @@ static const struct of_device_id sbsa_uart_of_match[] = {
};
MODULE_DEVICE_TABLE(of, sbsa_uart_of_match);
-static const struct acpi_device_id __maybe_unused sbsa_uart_acpi_match[] = {
+static const struct acpi_device_id sbsa_uart_acpi_match[] = {
{ "ARMH0011", 0 },
{ "ARMHB000", 0 },
{},
@@ -3014,8 +3014,8 @@ static struct platform_driver arm_sbsa_uart_platform_driver = {
.driver = {
.name = "sbsa-uart",
.pm = &pl011_dev_pm_ops,
- .of_match_table = of_match_ptr(sbsa_uart_of_match),
- .acpi_match_table = ACPI_PTR(sbsa_uart_acpi_match),
+ .of_match_table = sbsa_uart_of_match,
+ .acpi_match_table = sbsa_uart_acpi_match,
.suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_AMBA_PL011),
},
};
diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c
index 8dcad52eedfd..285b0fe41a86 100644
--- a/drivers/tty/serial/ma35d1_serial.c
+++ b/drivers/tty/serial/ma35d1_serial.c
@@ -799,7 +799,7 @@ static struct platform_driver ma35d1serial_driver = {
.resume = ma35d1serial_resume,
.driver = {
.name = "ma35d1-uart",
- .of_match_table = of_match_ptr(ma35d1_serial_of_match),
+ .of_match_table = ma35d1_serial_of_match,
},
};
--
2.39.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-25 16:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25 16:35 [PATCH] tty: serial: pl011: remove incorrect of_match_ptr annotation Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox