From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6133493772460947318==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] selftests/bpf: fix flexible_array.cocci warnings Date: Sat, 22 Jan 2022 16:58:33 +0800 Message-ID: <20220122085833.GA67205@fba2a898af35> In-Reply-To: <202201221618.3iotxtfv-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============6133493772460947318== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org In-Reply-To: <20220114163953.1455836-10-memxor@gmail.com> References: <20220114163953.1455836-10-memxor@gmail.com> TO: Kumar Kartikeya Dwivedi From: kernel test robot net/bpf/test_run.c:296:6-10: WARNING use flexible-array member instead (htt= ps://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 CC: Kumar Kartikeya Dwivedi Reported-by: kernel test robot Signed-off-by: kernel test robot --- url: https://github.com/0day-ci/linux/commits/Kumar-Kartikeya-Dwivedi/In= troduce-unstable-CT-lookup-helpers/20220115-004219 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git ma= ster :::::: branch date: 8 days ago :::::: commit date: 8 days ago Please take the patch only if it's a positive warning. Thanks! test_run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -293,7 +293,7 @@ struct prog_test_fail2 { struct prog_test_fail3 { int len; char arr1[2]; - char arr2[0]; + char arr2[]; }; = noinline void bpf_kfunc_call_test_pass_ctx(struct __sk_buff *skb) --===============6133493772460947318==--