From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id 8BE9D1C650 for ; Mon, 14 May 2018 07:10:21 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Mon, 14 May 2018 13:10:17 +0800 Message-ID: <152627461784.53156.12994381045130497126.stgit@localhost.localdomain> In-Reply-To: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain> References: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH v4 10/23] rte_mbuf.h: make sure RTE-MIN compares same types 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: Mon, 14 May 2018 05:10:21 -0000 /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); } /**