From: Andy Green Date: Tue, 22 May 2018 01:24:27 +0000 (+0800) Subject: mbuf: fix type of private size in detach X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ad3781066261848c163e700c3c5baa16fecc2247;p=dpdk.git mbuf: fix type of private size in detach GCC 8.1 warned: In function 'rte_pktmbuf_detach': rte_mbuf.h:1583:17: warning: conversion from 'uint32_t' {aka 'unsigned int'} to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] m->priv_size = priv_size; ^~~~~~~~~ The temp priv_size is declared as a uint32_t. But it only deals in uint16_t. m->priv_size is a uint16_t. Change it to a uint16_t. Fixes: 355e6735b3 ("mbuf: fix cloning with private mbuf data") Cc: stable@dpdk.org Signed-off-by: Andy Green Acked-by: Bruce Richardson --- diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 28fd4ad52f..76e37a2f81 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1571,7 +1571,8 @@ __rte_pktmbuf_free_direct(struct rte_mbuf *m) static inline void rte_pktmbuf_detach(struct rte_mbuf *m) { struct rte_mempool *mp = m->pool; - uint32_t mbuf_size, buf_len, priv_size; + uint32_t mbuf_size, buf_len; + uint16_t priv_size; if (RTE_MBUF_HAS_EXTBUF(m)) __rte_pktmbuf_free_extbuf(m);