mbuf: explicit cast of size on detach

GCC 8.1 warned:

In function 'rte_pktmbuf_detach':
rte_mbuf.h:1580:14: warning: conversion from 'long unsigned int'
to 'uint32_t' {aka 'unsigned int'} may change value [-Wconversion]
  mbuf_size = sizeof(struct rte_mbuf) + priv_size;
              ^~~~~~

Fixes: 355e6735b3 ("mbuf: fix cloning with private mbuf data")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
Andy Green 2018-05-17 21:50:22 +08:00 committed by Thomas Monjalon
parent 0298bfb263
commit c779ebdca0

View File

@ -1579,7 +1579,7 @@ static inline void rte_pktmbuf_detach(struct rte_mbuf *m)
__rte_pktmbuf_free_direct(m);
priv_size = rte_pktmbuf_priv_size(mp);
mbuf_size = sizeof(struct rte_mbuf) + priv_size;
mbuf_size = (uint32_t)(sizeof(struct rte_mbuf) + priv_size);
buf_len = rte_pktmbuf_data_room_size(mp);
m->priv_size = priv_size;