diff mbox series

[bpf-next] bpf: fix flexible_array.cocci warnings

Message ID alpine.DEB.2.22.394.2201221206320.12220@hadrien (mailing list archive)
State Accepted
Delegated to: BPF
Headers show
Series [bpf-next] bpf: fix flexible_array.cocci warnings | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 25 this patch: 25
netdev/cc_maintainers fail 1 blamed authors not CCed: ast@kernel.org; 11 maintainers not CCed: andrii@kernel.org kuba@kernel.org kpsingh@kernel.org daniel@iogearbox.net john.fastabend@gmail.com kafai@fb.com songliubraving@fb.com ast@kernel.org yhs@fb.com netdev@vger.kernel.org davem@davemloft.net
netdev/build_clang success Errors and warnings before: 46 this patch: 46
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 30 this patch: 30
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next success VM_Test
bpf/vmtest-bpf-next-PR success PR summary

Commit Message

Julia Lawall Jan. 22, 2022, 11:09 a.m. UTC
From: kernel test robot <lkp@intel.com>

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: c1ff181ffabc ("selftests/bpf: Extend kfunc selftests")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>
---

url:    https://github.com/0day-ci/linux/commits/Kumar-Kartikeya-Dwivedi/Introduce-unstable-CT-lookup-helpers/20220115-004219
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago

 test_run.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Borkmann Jan. 24, 2022, 4:24 p.m. UTC | #1
On 1/22/22 12:09 PM, Julia Lawall wrote:
> From: kernel test robot <lkp@intel.com>
> 
> 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: c1ff181ffabc ("selftests/bpf: Extend kfunc selftests")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
> CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>

Applied, thanks!
diff mbox series

Patch

--- 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)