tty: max310x: fix flexible_array.cocci warnings
authorkernel test robot <lkp@intel.com>
Tue, 9 Mar 2021 14:17:26 +0000 (15:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 09:24:27 +0000 (10:24 +0100)
Zero-length and one-element arrays are deprecated, see
Documentation/process/deprecated.rst
Flexible-array members should be used instead.

Generated by: scripts/coccinelle/misc/flexible_array.cocci

Fixes: 10d8b34a42171 ("serial: max310x: Driver rework")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2103091516020.2892@hadrien
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/max310x.c

index 1b61d26..8534d6e 100644 (file)
@@ -273,7 +273,7 @@ struct max310x_port {
 #ifdef CONFIG_GPIOLIB
        struct gpio_chip        gpio;
 #endif
-       struct max310x_one      p[0];
+       struct max310x_one      p[];
 };
 
 static struct uart_driver max310x_uart = {