[PATCH 19/32] net/dpaa2: replace memcpy with assignment

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


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

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/dpaa2/dpaa2_mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c
index 2f124313fa..3f259cd16f 100644
--- a/drivers/net/dpaa2/dpaa2_mux.c
+++ b/drivers/net/dpaa2/dpaa2_mux.c
@@ -293,7 +293,7 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 				ret);
 			goto creation_error;
 		}
-		rte_memcpy(&s_kg_cfg, &kg_cfg, sizeof(struct dpkg_profile_cfg));
+		s_kg_cfg = kg_cfg;
 	} else {
 		if (memcmp(&s_kg_cfg, &kg_cfg,
 			sizeof(struct dpkg_profile_cfg))) {
-- 
2.47.2



More information about the dev mailing list