From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4745086823415482584==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] futex2: fix flexible_array.cocci warnings Date: Thu, 01 Jul 2021 16:09:56 +0800 Message-ID: <20210701080956.GA8492@120e8b89e3bb> In-Reply-To: <202107011636.824hTX5p-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============4745086823415482584== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org TO: steven(a)liquorix.net From: kernel test robot kernel/futex2.c:65:21-28: WARNING use flexible-array member instead (https:= //www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-on= e-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: 64cdae0a6364 ("futex2: Implement wait and wake functions") CC: Andr=C3=A9 Almeida Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://github.com/zen-kernel/zen-kernel 5.12/futex2 head: f8ef78621cdaa4c962fd2a44deedeff3cc6067a0 commit: 64cdae0a6364c651f13a9ba90f6a8fadd7e1b9f7 [1/18] futex2: Implement w= ait and wake functions :::::: branch date: 9 hours ago :::::: commit date: 8 weeks ago Please take the patch only if it's a positive warning. Thanks! futex2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/futex2.c +++ b/kernel/futex2.c @@ -62,7 +62,7 @@ struct futex_waiter { struct futex_waiter_head { struct task_struct *task; bool hint; - struct futex_waiter objects[0]; + struct futex_waiter objects[]; }; = /** --===============4745086823415482584==--