summaryrefslogtreecommitdiff
path: root/lib/librte_mbuf
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2018-05-17 21:49:37 +0800
committerThomas Monjalon <thomas@monjalon.net>2018-05-21 00:21:05 +0200
commit553ff494cb4d7fa9539911d3bbb4d94de5f69f20 (patch)
tree9c8058d6274a1aa80b0636eeb7454562cc7df536 /lib/librte_mbuf
parentf6ffdf1c2c1cfbb2a3cbce246b545560609abeb5 (diff)
downloaddpdk-553ff494cb4d7fa9539911d3bbb4d94de5f69f20.zip
dpdk-553ff494cb4d7fa9539911d3bbb4d94de5f69f20.tar.gz
dpdk-553ff494cb4d7fa9539911d3bbb4d94de5f69f20.tar.xz
mbuf: explicit cast of headroom on reset
GCC 8.1 warned: rte_common.h:384:2: warning: conversion from 'int' to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] __extension__ ({ \ ^~~~~~~~~~~~~ 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. Fixes: 08b563ffb19d ("mbuf: replace data pointer by an offset") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'lib/librte_mbuf')
-rw-r--r--lib/librte_mbuf/rte_mbuf.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index b776a6f..0a94e3e 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);
}
/**