All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: prestera: fix flexible_array.cocci warnings
@ 2021-12-03  9:44 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2021-12-03  9:44 UTC (permalink / raw)
  To: Volodymyr Mytnyk
  Cc: kbuild-all, Linux Memory Management List, Serhiy Boiko,
	Taras Chornyi, Jakub Kicinski, netdev, linux-kernel

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 {

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] net: prestera: fix flexible_array.cocci warnings
@ 2021-12-03  1:24 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2021-12-03  1:24 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1797 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Volodymyr Mytnyk <vmytnyk@marvell.com>
CC: Serhiy Boiko <serhiy.boiko@marvell.com>
CC: Taras Chornyi <tchornyi@marvell.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/net/ethernet/marvell/prestera/prestera_hw.c:446:35-40: 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: 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>
---

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 {

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-04 17:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03  9:44 [PATCH] net: prestera: fix flexible_array.cocci warnings Julia Lawall
2021-12-03  9:44 ` Julia Lawall
2021-12-04 17:45 ` Volodymyr Mytnyk
2021-12-04 17:45 ` Volodymyr Mytnyk
  -- strict thread matches above, loose matches on Subject: below --
2021-12-03  1:24 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.