DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eventdev: replace zero-length-array
@ 2024-10-01 22:01 Stephen Hemminger
  2024-10-03 15:59 ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2024-10-01 22:01 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Liang Ma, Peter Mccarthy, Harry van Haaren,
	Amit Prakash Shukla, Jerin Jacob

Zero Length Array's (ZLA) are a Gcc extension, and standard
Variable Length Array (VLA) should be used instead.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/event/opdl/opdl_ring.c       | 2 +-
 drivers/event/sw/event_ring.h        | 2 +-
 lib/eventdev/rte_event_dma_adapter.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/event/opdl/opdl_ring.c b/drivers/event/opdl/opdl_ring.c
index 6799ec996b..60991c4b03 100644
--- a/drivers/event/opdl/opdl_ring.c
+++ b/drivers/event/opdl/opdl_ring.c
@@ -119,7 +119,7 @@ struct opdl_ring {
 	/* Stages indexed by ID */
 	struct opdl_stage *stages;
 	/* Memory for storing slot data */
-	alignas(RTE_CACHE_LINE_SIZE) uint8_t slots[0];
+	alignas(RTE_CACHE_LINE_SIZE) uint8_t slots[];
 };
 
 
diff --git a/drivers/event/sw/event_ring.h b/drivers/event/sw/event_ring.h
index 29db267b77..35931888dd 100644
--- a/drivers/event/sw/event_ring.h
+++ b/drivers/event/sw/event_ring.h
@@ -27,7 +27,7 @@ struct rob_ring {
 	uint32_t size;
 	uint32_t write_idx;
 	uint32_t read_idx;
-	alignas(RTE_CACHE_LINE_SIZE) void *ring[0];
+	alignas(RTE_CACHE_LINE_SIZE) void *ring[];
 };
 
 static inline struct rob_ring *
diff --git a/lib/eventdev/rte_event_dma_adapter.h b/lib/eventdev/rte_event_dma_adapter.h
index 768390cd30..5c480b82ff 100644
--- a/lib/eventdev/rte_event_dma_adapter.h
+++ b/lib/eventdev/rte_event_dma_adapter.h
@@ -204,7 +204,7 @@ struct rte_event_dma_adapter_op {
 	/**< Number of source segments. */
 	uint16_t nb_dst;
 	/**< Number of destination segments. */
-	struct rte_dma_sge src_dst_seg[0];
+	struct rte_dma_sge src_dst_seg[];
 	/**< Source and destination segments. */
 };
 
-- 
2.45.2


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

* Re: [PATCH] eventdev: replace zero-length-array
  2024-10-01 22:01 [PATCH] eventdev: replace zero-length-array Stephen Hemminger
@ 2024-10-03 15:59 ` Jerin Jacob
  2024-10-03 16:41   ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Jerin Jacob @ 2024-10-03 15:59 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Liang Ma, Peter Mccarthy, Harry van Haaren,
	Amit Prakash Shukla, Jerin Jacob

On Wed, Oct 2, 2024 at 3:39 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Zero Length Array's (ZLA) are a Gcc extension, and standard
> Variable Length Array (VLA) should be used instead.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>


Isn't this patch same
https://patches.dpdk.org/project/dpdk/patch/20240725171609.142344-1-stephen@networkplumber.org/
? It is already merged.
Making this as  "Not Applicable"

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

* Re: [PATCH] eventdev: replace zero-length-array
  2024-10-03 15:59 ` Jerin Jacob
@ 2024-10-03 16:41   ` Stephen Hemminger
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2024-10-03 16:41 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: dev, Liang Ma, Peter Mccarthy, Harry van Haaren,
	Amit Prakash Shukla, Jerin Jacob

On Thu, 3 Oct 2024 21:29:55 +0530
Jerin Jacob <jerinjacobk@gmail.com> wrote:

> On Wed, Oct 2, 2024 at 3:39 AM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > Zero Length Array's (ZLA) are a Gcc extension, and standard
> > Variable Length Array (VLA) should be used instead.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>  
> 
> 
> Isn't this patch same
> https://patches.dpdk.org/project/dpdk/patch/20240725171609.142344-1-stephen@networkplumber.org/
> ? It is already merged.
> Making this as  "Not Applicable"

I ran the devtools/cocci/zero_length_array.cocci script against main branch.

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

end of thread, other threads:[~2024-10-03 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-01 22:01 [PATCH] eventdev: replace zero-length-array Stephen Hemminger
2024-10-03 15:59 ` Jerin Jacob
2024-10-03 16:41   ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).