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 9ADE91CCCD for ; Sat, 12 May 2018 04:00:41 +0200 (CEST) From: Andy Green To: dev@dpdk.org Date: Sat, 12 May 2018 10:00:37 +0800 Message-ID: <152609043794.121661.2576318465909542545.stgit@localhost.localdomain> In-Reply-To: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> References: <152609021699.121661.5295227351721865436.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH v3 23/24] rte_hash_crc.h: explicit casts for truncation 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: Sat, 12 May 2018 02:00:41 -0000 /projects/lagopus/src/dpdk/build/include/rte_hash_crc.h: In function 'crc32c_sse42_u64_mimic': /projects/lagopus/src/dpdk/build/include/rte_hash_crc.h:402:40: warning: conversion from 'uint64_t' {aka 'long unsigned int'} to 'uint32_t' {aka 'unsigned int'} may change value [-Wconversion] init_val = crc32c_sse42_u32(d.u32[0], init_val); Signed-off-by: Andy Green --- lib/librte_hash/rte_hash_crc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h index 5f5fb3db1..cf28031b3 100644 --- a/lib/librte_hash/rte_hash_crc.h +++ b/lib/librte_hash/rte_hash_crc.h @@ -398,9 +398,9 @@ crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val) } d; d.u64 = data; - init_val = crc32c_sse42_u32(d.u32[0], init_val); - init_val = crc32c_sse42_u32(d.u32[1], init_val); - return init_val; + init_val = crc32c_sse42_u32(d.u32[0], (uint32_t)init_val); + init_val = crc32c_sse42_u32(d.u32[1], (uint32_t)init_val); + return (uint32_t)init_val; } #endif @@ -412,7 +412,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) "crc32q %[data], %[init_val];" : [init_val] "+r" (init_val) : [data] "rm" (data)); - return init_val; + return (uint32_t)init_val; } #endif