From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7625883458378637926==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: misc: fix flexible_array.cocci warnings Date: Mon, 08 Mar 2021 11:37:51 +0800 Message-ID: <20210308033751.GA33916@8a16bdd473dc> In-Reply-To: <202103081103.tyBBOxIB-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============7625883458378637926== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)01.org CC: linux-kernel(a)vger.kernel.org TO: Denis Efremov CC: Julia Lawall CC: "Greg Kroah-Hartman" CC: Jiri Slaby CC: linux-serial(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/tty/serial/max310x.c:276:20-21: WARNING use flexible-array member i= nstead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero= -length-and-one-element-arrays) 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: 7b36c1398fb6 ("coccinelle: misc: add flexible_array.cocci script") CC: Denis Efremov Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = master head: 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32 commit: 7b36c1398fb63f9c38cc83dc75f143d2e5995062 coccinelle: misc: add flex= ible_array.cocci script :::::: branch date: 6 hours ago :::::: commit date: 5 months ago Please take the patch only if it's a positive warning. Thanks! max310x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -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 =3D { --===============7625883458378637926==--