[dpdk-dev,v5,13/21] rte_ip.h: cast input to bswap16 to be uint16
Checks
Commit Message
In file included from /projects/lagopus/src/dpdk/
build/include/rte_ether.h:24,
from /projects/lagopus/src/dpdk/
build/include/rte_ethdev.h:158,
from ./dpdk/worker.c:90:
/projects/lagopus/src/dpdk/build/include/rte_ip.h:
In function 'rte_raw_cksum_mbuf':
/projects/lagopus/src/dpdk/build/include/rte_ip.h:
225:22: warning: conversion from 'uint32_t'
{aka 'unsigned int'} to 'uint16_t' {aka 'short
unsigned int'} may change value [-Wconversion]
tmp = rte_bswap16(tmp);
^~~
/projects/lagopus/src/dpdk/build/include/
rte_byteorder.h:53:25: note: in definition of
macro 'rte_bswap16'
rte_arch_bswap16(x)))
^
Signed-off-by: Andy Green <andy@warmcat.com>
---
lib/librte_net/rte_ip.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -222,7 +222,7 @@ rte_raw_cksum_mbuf(const struct rte_mbuf *m, uint32_t off, uint32_t len,
for (;;) {
tmp = __rte_raw_cksum(buf, seglen, 0);
if (done & 1)
- tmp = rte_bswap16(tmp);
+ tmp = rte_bswap16((uint16_t)tmp);
sum += tmp;
done += seglen;
if (done == len)