From patchwork Tue Jul 3 10:31:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 42145 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1937D1BEEA; Tue, 3 Jul 2018 12:32:18 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 615601BEEA for ; Tue, 3 Jul 2018 12:32:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2018 03:32:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,303,1526367600"; d="scan'208";a="63749977" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by fmsmga002.fm.intel.com with ESMTP; 03 Jul 2018 03:32:14 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Tue, 3 Jul 2018 11:31:18 +0100 Message-Id: <20180703103119.15747-8-bruce.richardson@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180703103119.15747-1-bruce.richardson@intel.com> References: <20180608163807.66737-1-bruce.richardson@intel.com> <20180703103119.15747-1-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH v2 7/8] net/avp: fix 32-bit meson builds X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When compiling with meson, extra warnings are enabled about casting from integers to different size pointers. This triggers an error in AVP as the addition of the offset to the pointer address causes the result to be a 64-bit integer which doesn't fit a 32-bit pointer. The fix here is to explicitly indicate that the offset is of type "uintptr_t" which prevents any promotion which would cause errors. Fixes: c0ad584222b5 ("net/avp: add device initialization") Signed-off-by: Bruce Richardson Acked-by: Allain Legacy Series-acked-by: Hemant Agrawal --- drivers/net/avp/avp_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index dc97e60e6..5e859c8dd 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -383,7 +383,7 @@ avp_dev_translate_address(struct rte_eth_dev *eth_dev, (host_phys_addr < (map->phys_addr + map->length))) { /* address is within this segment */ offset += (host_phys_addr - map->phys_addr); - addr = RTE_PTR_ADD(addr, offset); + addr = RTE_PTR_ADD(addr, (uintptr_t)offset); PMD_DRV_LOG(DEBUG, "Translating host physical 0x%" PRIx64 " to guest virtual 0x%p\n", host_phys_addr, addr);