From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6513854535305354142==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: misc: fix flexible_array.cocci warnings Date: Wed, 10 Mar 2021 14:07:43 +0800 Message-ID: <20210310060742.GA127820@da48b91e3745> In-Reply-To: <202103101437.hNSMq96N-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============6513854535305354142== 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: Johan Hovold CC: Alex Elder CC: "Greg Kroah-Hartman" CC: greybus-dev(a)lists.linaro.org CC: devel(a)driverdev.osuosl.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/staging/greybus/usb.c:30:4-7: WARNING use flexible-array member ins= tead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-l= ength-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: 05a59d79793d482f628a31753c671f2e92178a21 commit: 7b36c1398fb63f9c38cc83dc75f143d2e5995062 coccinelle: misc: add flex= ible_array.cocci script :::::: branch date: 5 hours ago :::::: commit date: 5 months ago Please take the patch only if it's a positive warning. Thanks! usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/greybus/usb.c +++ b/drivers/staging/greybus/usb.c @@ -27,7 +27,7 @@ struct gb_usb_hub_control_request { }; = struct gb_usb_hub_control_response { - u8 buf[0]; + u8 buf[]; }; = struct gb_usb_device { --===============6513854535305354142==--