From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 868665B1C for ; Thu, 17 May 2018 12:50:46 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2018 03:50:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,410,1520924400"; d="scan'208";a="229382983" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.55]) by fmsmga006.fm.intel.com with SMTP; 17 May 2018 03:50:43 -0700 Received: by (sSMTP sendmail emulation); Thu, 17 May 2018 11:50:43 +0100 Date: Thu, 17 May 2018 11:50:42 +0100 From: Bruce Richardson To: Andy Green Cc: dev@dpdk.org Message-ID: <20180517105042.GC22048@bricha3-MOBL.ger.corp.intel.com> References: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain> <152627462287.53156.1972221889368883834.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152627462287.53156.1972221889368883834.stgit@localhost.localdomain> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v4 11/23] rte_mbuf.h: explicit cast restricting ptrdiff to uint16 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: , X-List-Received-Date: Thu, 17 May 2018 10:50:46 -0000 On Mon, May 14, 2018 at 01:10:22PM +0800, Andy Green wrote: > /projects/lagopus/src/dpdk/build/include/rte_common.h:141:34: > warning: conversion from 'long unsigned int' to 'uint16_t' > {aka 'short unsigned int'} may change value [-Wconversion] > #define RTE_PTR_DIFF(ptr1, ptr2) ((uintptr_t)(ptr1) - > (uintptr_t)(ptr2)) > ^ > /projects/lagopus/src/dpdk/build/include/rte_mbuf.h:1360:13: > note: in expansion of macro 'RTE_PTR_DIFF' > *buf_len = RTE_PTR_DIFF(shinfo, buf_addr); > > Signed-off-by: Andy Green > --- > lib/librte_mbuf/rte_mbuf.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > index a27dbb878..0580ec8a0 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -1358,7 +1358,7 @@ rte_pktmbuf_ext_shinfo_init_helper(void *buf_addr, uint16_t *buf_len, > shinfo->fcb_opaque = fcb_opaque; > rte_mbuf_ext_refcnt_set(shinfo, 1); > > - *buf_len = RTE_PTR_DIFF(shinfo, buf_addr); > + *buf_len = (uint16_t)RTE_PTR_DIFF(shinfo, buf_addr); > return shinfo; > } Acked-by: Bruce Richardson