public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbox@nvidia.com>
Subject: [PATCH 1/4] examples/vhost: replace memcpy with assignment
Date: Wed, 21 Jan 2026 09:04:54 -0800	[thread overview]
Message-ID: <20260121170540.785735-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20260121170540.785735-1-stephen@networkplumber.org>

Better to use structure assignment to preserve type info.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/vhost/main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 4391d88c3d..ac888348d2 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -405,9 +405,8 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_devices)
 		conf.pool_map[i].pools = (1UL << i);
 	}
 
-	(void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
-	(void)(rte_memcpy(&eth_conf->rx_adv_conf.vmdq_rx_conf, &conf,
-		   sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+	*eth_conf = vmdq_conf_default;
+	eth_conf->rx_adv_conf.vmdq_rx_conf = conf;
 	return 0;
 }
 
-- 
2.51.0


  reply	other threads:[~2026-01-21 17:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 17:04 [PATCH 0/4] examples: memcpy cleanups Stephen Hemminger
2026-01-21 17:04 ` Stephen Hemminger [this message]
2026-01-21 17:04 ` [PATCH 2/4] examples/vmdq: replace memcpy with structure assignment Stephen Hemminger
2026-01-21 17:04 ` [PATCH 3/4] examples/vmdq_dcb: replace memcpy with assignment Stephen Hemminger
2026-01-21 17:04 ` [PATCH 4/4] examples: remove unnecessary include Stephen Hemminger
2026-02-17 17:43   ` Thomas Monjalon
2026-01-21 18:55 ` [PATCH 0/4] examples: memcpy cleanups Morten Brørup
2026-02-17 17:49   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260121170540.785735-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox