summaryrefslogtreecommitdiff
path: root/lib/librte_mbuf
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2018-05-17 21:49:42 +0800
committerThomas Monjalon <thomas@monjalon.net>2018-05-21 00:21:12 +0200
commit0298bfb26371ac31654444ea8494b30ceccc3b76 (patch)
tree0545432b1cc960033957e9d3f0d7b9939ce9df8a /lib/librte_mbuf
parent553ff494cb4d7fa9539911d3bbb4d94de5f69f20 (diff)
downloaddpdk-0298bfb26371ac31654444ea8494b30ceccc3b76.zip
dpdk-0298bfb26371ac31654444ea8494b30ceccc3b76.tar.gz
dpdk-0298bfb26371ac31654444ea8494b30ceccc3b76.tar.xz
mbuf: explicit cast of external buffer length
GCC 8.1 warned: 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)) ^ rte_mbuf.h:1360:13: note: in expansion of macro 'RTE_PTR_DIFF' *buf_len = RTE_PTR_DIFF(shinfo, buf_addr); Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer") 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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 0a94e3e..ae0fa4d 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1360,7 +1360,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;
}