[03/32] app/graph: replace memcpy with structure assignment

Message ID 20250208203142.242284-4-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 struct-assign.cocci.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/graph/ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/app/graph/ethdev.c b/app/graph/ethdev.c
index d343235dae..2f4cf65c96 100644
--- a/app/graph/ethdev.c
+++ b/app/graph/ethdev.c
@@ -422,7 +422,7 @@  ethdev_process(const char *name, struct ethdev_config *params)
 	}
 
 	/* Port */
-	memcpy(&port_conf, &port_conf_default, sizeof(struct rte_eth_conf));
+	port_conf = port_conf_default;
 	if (rss) {
 		uint64_t rss_hf = RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP | RTE_ETH_RSS_UDP;