dmadev: replace zero length array
PATCH 1/1 dmadev: replace zero length array
Use of zero length arrays is Gcc extension.
Found by zero_length_array.cocci.
--- lib/dmadev/rte_dmadev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/dmadev/rte_dmadev.h +1 -1
@@ -856,7 +856,7 @@ struct rte_dma_op {/** Number of destination segments. */ uint16_t nb_dst;/** Source and destination segments. */ -struct rte_dma_sge src_dst_seg[0 ]; +struct rte_dma_sge src_dst_seg[]; };#ifdef __cplusplus
Signature · 1 line
2.47.3
Quoted 15 lines · Stephen Hemminger
Use of zero length arrays is Gcc extension.
Found byzero_length_array.cocci.Fixes 9674119fbf27 ("dmadev: add enqueue/dequeue operations")Signed-off-by Stephen Hemminger <[email protected]>--- lib/dmadev/rte_dmadev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/dmadev/rte_dmadev.h +0
-0
lib/dmadev/rte_dmadev.h struct rte_dma_op { · line 861
Quoted 7 lines
lib/dmadev/rte_dmadev.h +1
-1@@ -856,7 +856,7 @@ struct rte_dma_op {/** Number of destination segments. */ uint16_t nb_dst;/** Source and destination segments. */ -struct rte_dma_sge src_dst_seg[0 ]; +struct rte_dma_sge src_dst_seg[]; };
Morten Brørup
Acked-byQuoted 14 lines
From: Bruce Richardson [mailto:[email protected]]
Sent: Thursday, 16 October 2025 10.15Quoted 10 lines · Stephen Hemminger
Use of zero length arrays is Gcc extension.
Found byzero_length_array.cocci.Fixes 9674119fbf27 ("dmadev: add enqueue/dequeue operations")Signed-off-by Stephen Hemminger <[email protected]>--- lib/dmadev/rte_dmadev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
lib/dmadev/rte_dmadev.h struct rte_dma_op { · line 861
Quoted 12 lines
lib/dmadev/rte_dmadev.h +1
-1@@ -856,7 +856,7 @@ struct rte_dma_op {/** Number of destination segments. */ uint16_t nb_dst;/** Source and destination segments. */ -struct rte_dma_sge src_dst_seg[0 ]; +struct rte_dma_sge src_dst_seg[]; };Acked-by Bruce Richardson <[email protected]>
Pavan Nikhilesh Bhagavatula
Acked-byQuoted 27 lines
Quoted 14 lines
From: Bruce Richardson [mailto:[email protected]]
Sent: Thursday, 16 October 2025 10.15Quoted 10 lines · Stephen Hemminger
Use of zero length arrays is Gcc extension.
Found byzero_length_array.cocci.Fixes 9674119fbf27 ("dmadev: add enqueue/dequeue operations")Signed-off-by Stephen Hemminger <[email protected]>--- lib/dmadev/rte_dmadev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 13 lines
lib/dmadev/rte_dmadev.h struct rte_dma_op { · line 861
Quoted 12 lines
lib/dmadev/rte_dmadev.h +1
-1@@ -856,7 +856,7 @@ struct rte_dma_op {/** Number of destination segments. */ uint16_t nb_dst;/** Source and destination segments. */ -struct rte_dma_sge src_dst_seg[0 ]; +struct rte_dma_sge src_dst_seg[]; };Acked-by Bruce Richardson <[email protected]>
Quoted 1 line
Acked-by Morten Brørup <[email protected]>
Thanks Stephan,
We should probably add this check to CI.
Thomas Monjalon
Applied16/10/2025 11:50, Pavan Nikhilesh Bhagavatula:
Quoted 11 lines
Quoted 7 lines
From: Bruce Richardson [mailto:[email protected]]
Quoted 5 lines · Stephen Hemminger
lib/dmadev/rte_dmadev.h struct rte_dma_op { · line 859
Quoted 3 lines
lib/dmadev/rte_dmadev.h +1
-1-struct rte_dma_sge src_dst_seg[0 ]; +struct rte_dma_sge src_dst_seg[];Acked-by Bruce Richardson <[email protected]>Acked-by Morten Brørup <[email protected]>Thanks Stephan,
Applied, thanks.
Quoted 1 line
We should probably add this check to CI.
Yes