From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id DAFC91C686 for ; Mon, 14 May 2018 07:11:06 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Mon, 14 May 2018 13:11:03 +0800 Message-ID: <152627466314.53156.13302800039306213752.stgit@localhost.localdomain> In-Reply-To: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain> References: <152627436523.53156.4398253089110011263.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH v4 19/23] rte_ip.h: cast input to bswap16 to be uint16 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 05:11:07 -0000 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 --- lib/librte_net/rte_ip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h index f32684c66..b46a0c717 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -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)