[PATCH] ethdev: replace rte_memcpy with assignment
Andrew Rybchenko
andrew.rybchenko at oktetlabs.ru
Thu Oct 1 10:14:13 CEST 2026
On 9/29/26 6:57 PM, Stephen Hemminger wrote:
> Can use structure assignment instead of rte_memcpy here.
It would be useful to mention in the description or summary why
it is better.
Right now the description say what is done, but it is obvious
from the code change.
>
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
> lib/ethdev/rte_ethdev.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index 7c57a9bb8f..6f5a957d00 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -16,7 +16,6 @@
> #include <rte_log.h>
> #include <rte_interrupts.h>
> #include <rte_kvargs.h>
> -#include <rte_memcpy.h>
> #include <rte_common.h>
> #include <rte_mempool.h>
> #include <rte_malloc.h>
> @@ -631,7 +630,7 @@ rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)
> rte_spinlock_lock(rte_mcfg_ethdev_get_lock());
>
> if (eth_dev_shared_data_prepare() != NULL) {
> - rte_memcpy(owner, ðdev->data->owner, sizeof(*owner));
> + *owner = ethdev->data->owner;
> ret = 0;
> } else {
> ret = -ENOMEM;
More information about the dev
mailing list