[09/32] ml/cnxk: replace memcpy with assignment

Message ID 20250208203142.242284-10-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:22 p.m. UTC
Prefer structure assignment over memcpy.
Found by cocci/struct_assign.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/ml/cnxk/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c
index d93c31535d..9958945670 100644
--- a/drivers/ml/cnxk/cnxk_ml_ops.c
+++ b/drivers/ml/cnxk/cnxk_ml_ops.c
@@ -1398,7 +1398,7 @@  cnxk_ml_model_info_get(struct rte_ml_dev *dev, uint16_t model_id,
 	}
 
 	info = (struct rte_ml_model_info *)model->info;
-	rte_memcpy(model_info, info, sizeof(struct rte_ml_model_info));
+	*model_info = *info;
 	model_info->input_info = info->input_info;
 	model_info->output_info = info->output_info;