GCC 8.1 warned:
"1 + value", where value is an uint16_t causes promotion
to a signed int. The compiler complained that we are
shoving an int into a uint16_t return type with different
size and sign.
Bumping and returning value directly instead removes the
promotion and the problem.
Fixes:
f20b50b946da ("mbuf: optimize refcnt update")
Fixes:
a53aa2b9f3be ("mbuf: support attaching external buffer")
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
* reference counter can occur.
*/
if (likely(rte_mbuf_refcnt_read(m) == 1)) {
- rte_mbuf_refcnt_set(m, 1 + value);
- return 1 + value;
+ ++value;
+ rte_mbuf_refcnt_set(m, value);
+ return value;
}
return __rte_mbuf_refcnt_update(m, value);
int16_t value)
{
if (likely(rte_mbuf_ext_refcnt_read(shinfo) == 1)) {
- rte_mbuf_ext_refcnt_set(shinfo, 1 + value);
- return 1 + value;
+ ++value;
+ rte_mbuf_ext_refcnt_set(shinfo, value);
+ return value;
}
return (uint16_t)rte_atomic16_add_return(&shinfo->refcnt_atomic, value);