]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
serial: 8250_platform: fix uart_8250_port initializer
authorArnd Bergmann <arnd@arndb.de>
Wed, 7 Aug 2024 07:57:44 +0000 (09:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Aug 2024 11:06:57 +0000 (13:06 +0200)
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>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/r/20240807075751.2206508-2-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_platform.c

index 35f2e1494a5e6d2a1931f6d306b245a75e1a4db0..3fa52f014c4dab0ea3938e71d9ee352752ffcafc 100644 (file)
@@ -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 = { };
+       struct uart_8250_port uart = { };
        struct resource *regs;
        unsigned char iotype;
        int ret, line;