serial: 8250_platform: remove ACPI_PTR() annotation
PATCH 1/2 serial: 8250_platform: remove ACPI_PTR() annotation
From: Arnd Bergmann <[email protected]>
The acpi_platform_serial_table[] array is defined globally without an #ifdef check for CONFIG_ACPI, so ACPI_PTR() makes no sense here:
drivers/tty/serial/8250/8250_platform.c:271:36: error: 'acpi_platform_serial_table' defined but not used [-Werror=unused-const-variable=]
271 | static const struct acpi_device_id acpi_platform_serial_table[] = {
--- drivers/tty/serial/8250/8250_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_platform.c +1 -1
@@ -281,7 +281,7 @@ static struct platform_driver serial8250_isa_driver = { .resume = serial8250_resume, .driver = { .name = "serial8250", - .acpi_match_table = ACPI_PTR(acpi_platform_serial_table), + .acpi_match_table = acpi_platform_serial_table, }, };
Signature · 1 line
2.39.2
PATCH 2/2 serial: 8250_platform: fix uart_8250_port initializer
From: Arnd Bergmann <[email protected]>
The first element in uart_8250_port is a structure, so initializing it to 0 causes a warning on newer compilers:
drivers/tty/serial/8250/8250_platform.c: In function 'serial8250_platform_probe':drivers/tty/serial/8250/8250_platform.c:111:40: error: excess elements in struct initializer [-Werror]
111 | struct uart_8250_port uart = { 0 };
Use the modern empty {} initializer instead that works on all supported compilers.
--- drivers/tty/serial/8250/8250_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_platform.c +1 -1
@@ -108,7 +108,7 @@ void __init serial8250_isa_init_ports(void)static int serial8250_platform_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct uart_8250_port uart = {0 }; +struct uart_8250_port uart = { };struct resource *regs;unsigned char iotype;int ret, line;
Signature · 1 line
2.39.2
Re: [PATCH 2/2] serial: 8250_platform: fix uart_8250_port initializer
Hi Arnd,
Quoted 23 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The first element in
uart_8250_portis a structure, so initializing it to 0 causes a warning on newer compilers:
drivers/tty/serial/8250/8250_platform.c: In function 'serial8250_platform_probe':drivers/tty/serial/8250/8250_platform.c:111:40: error: excess elements in struct initializer [-Werror]
111 | structuart_8250_portuart = { 0 };Use the modern empty {} initializer instead that works on all supported compilers.
Fixes d9e5a0ce2f16 ("serial: 8250_platform: Enable generic 16550A platform devices")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/tty/serial/8250/8250_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tty/serial/8250/8250_platform.c +0
-0
drivers/tty/serial/8250/8250_platform.c void __init serial8250_isa_init_ports(void) · line 111
Quoted 5 lines
drivers/tty/serial/8250/8250_platform.c +1
-1@@ -108,7 +108,7 @@ void __init serial8250_isa_init_ports(void)static int serial8250_platform_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct uart_8250_port uart = {0 }; +struct uart_8250_port uart = { };
Thanks! I was not sure about this. So, I sent a patch to use memset just couple of hours ago. I sent different fix for other ACPI_PTR issue as well. But I think your fixes are better.
Thanks!
Sunil
Quoted 20 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The acpi_platform_serial_table[] array is defined globally without an #ifdef check for
CONFIG_ACPI, soACPI_PTR()makes no sense here:
drivers/tty/serial/8250/8250_platform.c:271:36: error: 'acpi_platform_serial_table' defined but not used [-Werror=unused-const-variable=]
271 | static const structacpi_device_idacpi_platform_serial_table[] = {Fixes d9e5a0ce2f16 ("serial: 8250_platform: Enable generic 16550A platform devices")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/tty/serial/8250/8250_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tty/serial/8250/8250_platform.c +0
-0
drivers/tty/serial/8250/8250_platform.c static struct platform_driver serial8250_isa_driver = { · line 284
Quoted 5 lines
drivers/tty/serial/8250/8250_platform.c +1
-1@@ -281,7 +281,7 @@ static struct platform_driver serial8250_isa_driver = { .resume = serial8250_resume, .driver = { .name = "serial8250", - .acpi_match_table = ACPI_PTR(acpi_platform_serial_table), + .acpi_match_table = acpi_platform_serial_table,
Thanks!
Sunil
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The acpi_platform_serial_table[] array is defined globally without an #ifdef check for
CONFIG_ACPI, soACPI_PTR()makes no sense here:
drivers/tty/serial/8250/8250_platform.c:271:36: error: 'acpi_platform_serial_table' defined but not used [-Werror=unused-const-variable=]
271 | static const structacpi_device_idacpi_platform_serial_table[] = {
Yeah, that patch went into kernel without my review as I was on a long leave.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 2/2] serial: 8250_platform: fix uart_8250_port initializer
In reply to Arnd BergmannQuoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The first element in
uart_8250_portis a structure, so initializing it to 0 causes a warning on newer compilers:
drivers/tty/serial/8250/8250_platform.c: In function 'serial8250_platform_probe':drivers/tty/serial/8250/8250_platform.c:111:40: error: excess elements in struct initializer [-Werror]
111 | structuart_8250_portuart = { 0 };Use the modern empty {} initializer instead that works on all supported compilers.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 2/2] serial: 8250_platform: fix uart_8250_port initializer
In reply to Arnd BergmannQuoted 24 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The first element in
uart_8250_portis a structure, so initializing it to 0 causes a warning on newer compilers:
drivers/tty/serial/8250/8250_platform.c: In function 'serial8250_platform_probe':drivers/tty/serial/8250/8250_platform.c:111:40: error: excess elements in struct initializer [-Werror]
111 | structuart_8250_portuart = { 0 };Use the modern empty {} initializer instead that works on all supported compilers.
Fixes d9e5a0ce2f16 ("serial: 8250_platform: Enable generic 16550A platform devices")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/tty/serial/8250/8250_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tty/serial/8250/8250_platform.c +0
-0
drivers/tty/serial/8250/8250_platform.c void __init serial8250_isa_init_ports(void) · line 114
Quoted 8 lines
drivers/tty/serial/8250/8250_platform.c +1
-1@@ -108,7 +108,7 @@ void __init serial8250_isa_init_ports(void)static int serial8250_platform_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct uart_8250_port uart = {0 }; +struct uart_8250_port uart = { };struct resource *regs;unsigned char iotype;int ret, line;
Signature · 1 line
i.