[PATCH 09/32] ml/cnxk: replace memcpy with assignment
Stephen Hemminger
stephen at networkplumber.org
Sat Feb 8 21:22:01 CET 2025
Prefer structure assignment over memcpy.
Found by cocci/struct_assign.cocci
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.47.2
More information about the dev
mailing list