diff mbox series

net: prestera: fix flexible_array.cocci warnings

Message ID alpine.DEB.2.22.394.2112031043180.5247@hadrien (mailing list archive)
State New
Headers show
Series net: prestera: fix flexible_array.cocci warnings | expand

Commit Message

Julia Lawall Dec. 3, 2021, 9:44 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: 6e36c7bcb461 ("net: prestera: add counter HW API")
CC: Volodymyr Mytnyk <vmytnyk@marvell.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>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   9606f9efb1cec7f8f5912326f182fbfbcad34382
commit: 6e36c7bcb4611414b339173cdc33fdcb55c08f9e [4129/4921] net: prestera: add counter HW API
:::::: branch date: 19 hours ago
:::::: commit date: 3 days ago

Please take the patch only if it's a positive warning. Thanks!

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

Comments

Volodymyr Mytnyk Dec. 4, 2021, 5:45 p.m. UTC | #1
> Subject: [PATCH] net: prestera: fix flexible_array.cocci warnings 
>  
> 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: 6e36c7bcb461 ("net: prestera: add counter HW API")
> CC: Volodymyr Mytnyk <vmytnyk@marvell.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>
> ---
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   9606f9efb1cec7f8f5912326f182fbfbcad34382
> commit: 6e36c7bcb4611414b339173cdc33fdcb55c08f9e [4129/4921] net: prestera: add counter HW API
> :::::: branch date: 19 hours ago
> :::::: commit date: 3 days ago
> 
> Please take the patch only if it's a positive warning. Thanks!
> 
>  prestera_hw.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/net/ethernet/marvell/prestera/prestera_hw.c
> +++ b/drivers/net/ethernet/marvell/prestera/prestera_hw.c
> @@ -443,7 +443,7 @@ struct prestera_msg_counter_resp {
>          __le32 offset;
>          __le32 num_counters;
>          __le32 done;
> -       struct prestera_msg_counter_stats stats[0];
> +       struct prestera_msg_counter_stats stats[];
>  };
> 
>  struct prestera_msg_span_req {

Hi Julia,

Fixed in https://www.spinics.net/lists/kernel/msg4167402.html

Thanks and Regards,
Volodymyr
diff mbox series

Patch

--- a/drivers/net/ethernet/marvell/prestera/prestera_hw.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_hw.c
@@ -443,7 +443,7 @@  struct prestera_msg_counter_resp {
 	__le32 offset;
 	__le32 num_counters;
 	__le32 done;
-	struct prestera_msg_counter_stats stats[0];
+	struct prestera_msg_counter_stats stats[];
 };

 struct prestera_msg_span_req {