[PATCH] serial: 8250_platform: Fix unused acpi_platform_serial_table warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The LKP reports below warning.

>> drivers/tty/serial/8250/8250_platform.c:271:36: warning: 'acpi_platform_serial_table' defined but not used [-Wunused-const-variable=]

     271 | static const struct acpi_device_id acpi_platform_serial_table[] = {
         |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~

This is because some architectures don't define either ACPI or
MODULE/MODULE_DEVICE_TABLE. So, keep acpi_platform_serial_table under
CONFIG_ACPI to fix the warning on such architectures.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202407310047.PIoWlrZZ-lkp@xxxxxxxxx/
Fixes: d9e5a0ce2f16 ("serial: 8250_platform: Enable generic 16550A platform devices")
Signed-off-by: Sunil V L <sunilvl@xxxxxxxxxxxxxxxx>
---
 drivers/tty/serial/8250/8250_platform.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_platform.c b/drivers/tty/serial/8250/8250_platform.c
index bdfb16bed4f2..168e635002aa 100644
--- a/drivers/tty/serial/8250/8250_platform.c
+++ b/drivers/tty/serial/8250/8250_platform.c
@@ -268,11 +268,13 @@ static int serial8250_resume(struct platform_device *dev)
 	return 0;
 }
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id acpi_platform_serial_table[] = {
 	{ "RSCV0003", 0 }, // RISC-V Generic 16550A UART
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, acpi_platform_serial_table);
+#endif
 
 static struct platform_driver serial8250_isa_driver = {
 	.probe		= serial8250_probe,
-- 
2.43.0





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux