[PATCH 05/32] dma/dpaa2: replace memcpy with assignment

Stephen Hemminger stephen at networkplumber.org
Sat Feb 8 21:21:57 CET 2025


Prefer structure assignment over memcpy.
Found by cocci/struct_assign.cocci

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/dma/dpaa2/dpaa2_qdma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c
index 3c9a7b5485..c0e0a44e84 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma.c
+++ b/drivers/dma/dpaa2/dpaa2_qdma.c
@@ -171,9 +171,7 @@ dpaa2_qdma_multi_eq(struct qdma_virt_queue *qdma_vq)
 	if (unlikely(num_tx != qdma_vq->fd_idx)) {
 		dst_idx = 0;
 		for (idx = num_tx; idx < qdma_vq->fd_idx; idx++) {
-			rte_memcpy(&qdma_vq->fd[dst_idx],
-				&qdma_vq->fd[idx],
-				sizeof(struct qbman_fd));
+			qdma_vq->fd[dst_idx] = qdma_vq->fd[idx];
 			dst_idx++;
 		}
 	}
-- 
2.47.2



More information about the dev mailing list