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

Message ID 20250208203142.242284-6-stephen@networkplumber.org (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series Use structure assignment instead of memcpy |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Feb. 8, 2025, 8:21 p.m. UTC
Prefer structure assignment over memcpy.
Found by cocci/struct_assign.cocci

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

Comments

Hemant Agrawal Feb. 10, 2025, 10:42 a.m. UTC | #1
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  

Patch

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++;
 		}
 	}