From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0529207902003470055==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: misc: fix flexible_array.cocci warnings Date: Wed, 16 Dec 2020 07:04:16 +0800 Message-ID: <20201215230416.GA1423@ed0c45274a0f> In-Reply-To: <202012160706.c5O6SARt-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============0529207902003470055== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Denis Efremov CC: Julia Lawall CC: Dan Williams CC: Vishal Verma CC: Dave Jiang CC: Ira Weiny CC: "Rafael J. Wysocki" CC: Len Brown CC: linux-nvdimm(a)lists.01.org CC: linux-acpi(a)vger.kernel.org From: kernel test robot drivers/acpi/nfit/core.c:2271:3-10: WARNING use flexible-array member inste= ad (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-len= gth-and-one-element-arrays) drivers/acpi/nfit/core.c:2282:3-10: WARNING use flexible-array member inste= ad (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-len= gth-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: 148842c98a24e508aecb929718818fbf4c2a6ff3 commit: 7b36c1398fb63f9c38cc83dc75f143d2e5995062 coccinelle: misc: add flex= ible_array.cocci script :::::: branch date: 20 hours ago :::::: commit date: 2 months ago Please take the patch only if it's a positive warning. Thanks! core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2268,7 +2268,7 @@ struct nfit_set_info { u64 region_offset; u32 serial_number; u32 pad; - } mapping[0]; + } mapping[]; }; = struct nfit_set_info2 { @@ -2279,7 +2279,7 @@ struct nfit_set_info2 { u16 manufacturing_date; u8 manufacturing_location; u8 reserved[31]; - } mapping[0]; + } mapping[]; }; = static size_t sizeof_nfit_set_info(int num_mappings) --===============0529207902003470055==--