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 062081C6E9 for ; Mon, 14 May 2018 07:11:13 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Mon, 14 May 2018 13:11:08 +0800 Message-ID: <152627466817.53156.8811101443963610659.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 20/23] rte_ip.h: cast around promotion to int 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:14 -0000 /projects/lagopus/src/dpdk/build/include/ rte_ip.h: In function 'rte_ipv4_cksum': /projects/lagopus/src/dpdk/build/include/ rte_ip.h:256:35: warning: conversion from 'int' to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion] return (cksum == 0xffff) ? cksum : ~cksum; ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ 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 b46a0c717..8689e9113 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -253,7 +253,7 @@ rte_ipv4_cksum(const struct ipv4_hdr *ipv4_hdr) { uint16_t cksum; cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct ipv4_hdr)); - return (cksum == 0xffff) ? cksum : ~cksum; + return (cksum == 0xffff) ? cksum : (uint16_t)~cksum; } /**