DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] examples/kni: clear warning about discarding const qualifier
@ 2022-05-31  8:13 Ke Zhang
  2022-05-31  9:12 ` Bruce Richardson
  2022-06-06  7:22 ` [PATCH v3] kni: fix " Ke Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: Ke Zhang @ 2022-05-31  8:13 UTC (permalink / raw)
  To: ferruh.yigit, dev; +Cc: Ke Zhang

The warning info:
warning: passing argument 1 of ‘memcpy’ discards ‘const’
qualifier from pointer target type

Compulsory type conversion to clear compile warning.

Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
---
 kernel/linux/kni/kni_misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c
index 780187d8bf..6f9dab4732 100644
--- a/kernel/linux/kni/kni_misc.c
+++ b/kernel/linux/kni/kni_misc.c
@@ -403,10 +403,10 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,
 
 	/* if user has provided a valid mac address */
 	if (is_valid_ether_addr(dev_info.mac_addr))
-		memcpy(net_dev->dev_addr, dev_info.mac_addr, ETH_ALEN);
+		memcpy((unsigned char *)net_dev->dev_addr, dev_info.mac_addr, ETH_ALEN);
 	else
 		/* Generate random MAC address. */
-		eth_random_addr(net_dev->dev_addr);
+		eth_random_addr((uint8_t *)net_dev->dev_addr);
 
 	if (dev_info.mtu)
 		net_dev->mtu = dev_info.mtu;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-06  7:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31  8:13 [PATCH] examples/kni: clear warning about discarding const qualifier Ke Zhang
2022-05-31  9:12 ` Bruce Richardson
2022-05-31  9:22   ` Ferruh Yigit
2022-06-06  7:22 ` [PATCH v3] kni: fix " Ke Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).