diff mbox series

[2/2] serial: 8250_platform: fix uart_8250_port initializer

Message ID 20240807075751.2206508-2-arnd@kernel.org
State New
Headers show
Series [1/2] serial: 8250_platform: remove ACPI_PTR() annotation | expand

Commit Message

Arnd Bergmann Aug. 7, 2024, 7:57 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

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.

Fixes: d9e5a0ce2f16 ("serial: 8250_platform: Enable generic 16550A platform devices")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/tty/serial/8250/8250_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Aug. 8, 2024, 2:12 p.m. UTC | #1
On Wed, Aug 07, 2024 at 09:57:44AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_platform.c b/drivers/tty/serial/8250/8250_platform.c
index c9ef988d58b3..2a3765334843 100644
--- a/drivers/tty/serial/8250/8250_platform.c
+++ b/drivers/tty/serial/8250/8250_platform.c
@@ -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;