From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6AC37A0542; Tue, 31 May 2022 10:20:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C60D400EF; Tue, 31 May 2022 10:20:04 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id C279B400D6 for ; Tue, 31 May 2022 10:20:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653985203; x=1685521203; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XagVfa7ZTQ9al4LIIZa0RqrBXyTs6c06cEPaBYeiaLc=; b=jn/arj0ov/R0794OyVOr2woYIgtA02HUWBnocCqTLtkzV7oF2v91/dT2 juTAxieDtriPaU2KYQgm8JZK2TAEI4YwHS6nai1v+kP6snvyPYAVV+/kN aFwY0sUrEYStykg/////5aMY2pIpJru5FBOE6fX+8nZNIdOAwmCG5tDHT fwwZ74h7tBlNYFRrZ8CiC4wSS7bHuFK8hH01UDatyMhqutqipJ0GDhOKj XdqGfoIYJh7I6rxKewFGgl8Kl8nK73o+fMVnB3A3PedHspnr96k1JZEGK ptwq0Gp35hURKtmCEzi7SV7Ml9eGMxtpVBrDWypYz3AwETSFZo0ZoPY09 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10363"; a="361559444" X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="361559444" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 01:20:00 -0700 X-IronPort-AV: E=Sophos;i="5.91,264,1647327600"; d="scan'208";a="551674911" Received: from unknown (HELO localhost.localdomain) ([10.239.251.104]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2022 01:19:59 -0700 From: Ke Zhang To: ferruh.yigit@intel.com, dev@dpdk.org Cc: Ke Zhang Subject: [PATCH] examples/kni: clear warning about discarding const qualifier Date: Tue, 31 May 2022 08:13:04 +0000 Message-Id: <20220531081304.229902-1-ke1x.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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