Skip to content

Commit

Permalink
eventdev: do not use zero length arrays
Browse files Browse the repository at this point in the history
Zero length array's are a GNU C extension and should be replaced
by use of flexible arrayrs. This has been fixed almost everywhere
in DPDK 24.07 but looks like some event code got missed.

Generated by devtools/cocci/zero_length_array.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
  • Loading branch information
shemminger authored and jerinjacobk committed Sep 17, 2024
1 parent 76fc0bd commit 2b85b51
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/event/opdl/opdl_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
};


Expand Down
2 changes: 1 addition & 1 deletion drivers/event/sw/event_ring.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
2 changes: 1 addition & 1 deletion lib/eventdev/rte_event_dma_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
};

Expand Down

0 comments on commit 2b85b51

Please sign in to comment.