From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v4 10/23] rte_mbuf.h: make sure RTE-MIN compares same types Date: Thu, 17 May 2018 11:49:58 +0100 Message-ID: <20180517104957.GB22048@bricha3-MOBL.ger.corp.intel.com> References: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain> <152627461784.53156.12994381045130497126.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Andy Green Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 192985B1C for ; Thu, 17 May 2018 12:50:01 +0200 (CEST) Content-Disposition: inline In-Reply-To: <152627461784.53156.12994381045130497126.stgit@localhost.localdomain> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, May 14, 2018 at 01:10:17PM +0800, Andy Green wrote: > /projects/lagopus/src/dpdk/build/include/rte_common.h:384:2: > warning: conversion from 'int' to 'uint16_t' > {aka 'short unsigned int'} may change value [-Wconversion] > __extension__ ({ \ > ^~~~~~~~~~~~~ > /projects/lagopus/src/dpdk/build/include/rte_mbuf.h:1204:16: > note: in expansion of macro 'RTE_MIN' > m->data_off = RTE_MIN(RTE_PKTMBUF_HEADROOM, > (uint16_t)m->buf_len); > > RTE_PKTMBUF_HEADROOM is typ 128, so it doesn't make trouble. > > Signed-off-by: Andy Green > --- > lib/librte_mbuf/rte_mbuf.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > index c214f1945..a27dbb878 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -1201,7 +1201,8 @@ rte_pktmbuf_priv_size(struct rte_mempool *mp) > */ > static inline void rte_pktmbuf_reset_headroom(struct rte_mbuf *m) > { > - m->data_off = RTE_MIN(RTE_PKTMBUF_HEADROOM, (uint16_t)m->buf_len); > + m->data_off = (uint16_t)RTE_MIN((uint16_t)RTE_PKTMBUF_HEADROOM, > + (uint16_t)m->buf_len); > } > Not sure the cast before RTE_MIN is necessary, but it's harmless. Acked-by: Bruce Richardson