Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: serial: pl011: remove incorrect of_match_ptr annotation

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>
Link: https://lore.kernel.org/r/20250225163556.4169086-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
b5ad18a5 87975ca9

+4 -4
+3 -3
drivers/tty/serial/amba-pl011.c
··· 3051 3051 }; 3052 3052 MODULE_DEVICE_TABLE(of, sbsa_uart_of_match); 3053 3053 3054 - static const struct acpi_device_id __maybe_unused sbsa_uart_acpi_match[] = { 3054 + static const struct acpi_device_id sbsa_uart_acpi_match[] = { 3055 3055 { "ARMH0011", 0 }, 3056 3056 { "ARMHB000", 0 }, 3057 3057 {}, ··· 3064 3064 .driver = { 3065 3065 .name = "sbsa-uart", 3066 3066 .pm = &pl011_dev_pm_ops, 3067 - .of_match_table = of_match_ptr(sbsa_uart_of_match), 3068 - .acpi_match_table = ACPI_PTR(sbsa_uart_acpi_match), 3067 + .of_match_table = sbsa_uart_of_match, 3068 + .acpi_match_table = sbsa_uart_acpi_match, 3069 3069 .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_AMBA_PL011), 3070 3070 }, 3071 3071 };
+1 -1
drivers/tty/serial/ma35d1_serial.c
··· 799 799 .resume = ma35d1serial_resume, 800 800 .driver = { 801 801 .name = "ma35d1-uart", 802 - .of_match_table = of_match_ptr(ma35d1_serial_of_match), 802 + .of_match_table = ma35d1_serial_of_match, 803 803 }, 804 804 }; 805 805