diff mbox series

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

Message ID 20220125070519.GA56817@inn2.lkp.intel.com (mailing list archive)
State Superseded
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/apply fail Patch does not apply to bpf-next

Commit Message

kernel test robot Jan. 25, 2022, 7:05 a.m. UTC
From: kernel test robot <lkp@intel.com>

net/bpf/test_run.c:296:6-10: WARNING use flexible-array member instead (https://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

Fixes: c1ff181ffabc ("selftests/bpf: Extend kfunc selftests")
CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>
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>

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

Comments

Daniel Borkmann Jan. 25, 2022, 1:45 p.m. UTC | #1
On 1/25/22 8:05 AM, kernel test robot wrote:
> From: kernel test robot <lkp@intel.com>
> 
> net/bpf/test_run.c:296:6-10: WARNING use flexible-array member instead (https://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
> 
> Fixes: c1ff181ffabc ("selftests/bpf: Extend kfunc selftests")
> CC: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> 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>

Duplicate? Already applied via:

https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=ed8bb03222c965290026c8ead5a902f4140f5440

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