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 CED74AAA2 for ; Mon, 21 May 2018 04:01:08 +0200 (CEST) From: Andy Green To: dev@dpdk.org Cc: thomas@monjalon.net Date: Mon, 21 May 2018 10:00:58 +0800 Message-ID: <152686805827.58694.11447559809199835902.stgit@localhost.localdomain> In-Reply-To: <152686781484.58694.14737673447518527445.stgit@localhost.localdomain> References: <152686781484.58694.14737673447518527445.stgit@localhost.localdomain> User-Agent: StGit/unknown-version Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH v6 1/8] lib/librte_eal: explicit tmp cast 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, 21 May 2018 02:01:09 -0000 /projects/lagopus/src/dpdk/build/include/rte_memcpy.h: 793:2: note: in expansion of macro 'MOVEUNALIGNED_LEFT47' MOVEUNALIGNED_LEFT47(dst, src, n, srcofs); ^~~~~~~~~~~~~~~~~~~~ /projects/lagopus/src/dpdk/build/include/rte_memcpy.h: 649:51: warning: conversion from 'size_t' {aka 'long unsigned int'} to 'int' may change value [-Wconversion] case 0x0B: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0B); break; \ ^ /projects/lagopus/src/dpdk/build/include/rte_memcpy.h: 616:15: note: in definition of macro 'MOVEUNALIGNED_LEFT47_IMM' tmp = len; \ ^~~ /projects/lagopus/src/dpdk/build/include/rte_memcpy.h: 793:2: note: in expansion of macro 'MOVEUNALIGNED_LEFT47' MOVEUNALIGNED_LEFT47(dst, src, n, srcofs); ^~~~~~~~~~~~~~~~~~~~ /projects/lagopus/src/dpdk/build/include/rte_memcpy.h: 618:13: warning: conversion to 'size_t' {aka 'long unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion] tmp -= len; \ ^~ /projects/lagopus/src/dpdk/build/include/rte_memcpy.h: 649:16: note: in expansion of macro 'MOVEUNALIGNED_LEFT47_IMM' case 0x0B: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x0B); break; \ ^~~~~~~~~~~~~~~~~~~~~~~~ /projects/lagopus/src/dpdk/build/include/rte_memcpy.h: 793:2: note: in expansion of macro 'MOVEUNALIGNED_LEFT47' MOVEUNALIGNED_LEFT47(dst, src, n, srcofs); ^~~~~~~~~~~~~~~~~~~~ This provides an explicit cast for a cast that has always been happening, and still happens exactly the same after the cast. It doesn't change the generated code. /projects/lagopus/src/dpdk/build/include/rte_memcpy.h: 618:13: warning: conversion to 'size_t' {aka 'long unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion] tmp -= len; ^~ int tmp; ... - tmp -= len; + tmp -= (int)len; Signed-off-by: Andy Green Fixes: d35cc1fe6a ("eal/x86: revert select optimized memcpy at run-time") --- .../common/include/arch/x86/rte_memcpy.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h index 5ead68ab2..f9ea0ab69 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h @@ -597,9 +597,9 @@ __extension__ ({ _mm_storeu_si128((__m128i *)((uint8_t *)dst + 7 * 16), _mm_alignr_epi8(xmm8, xmm7, offset)); \ dst = (uint8_t *)dst + 128; \ } \ - tmp = len; \ + tmp = (int)len; \ len = ((len - 16 + offset) & 127) + 16 - offset; \ - tmp -= len; \ + tmp -= (int)len; \ src = (const uint8_t *)src + tmp; \ dst = (uint8_t *)dst + tmp; \ if (len >= 32 + 16 - offset) { \ @@ -613,9 +613,9 @@ __extension__ ({ _mm_storeu_si128((__m128i *)((uint8_t *)dst + 1 * 16), _mm_alignr_epi8(xmm2, xmm1, offset)); \ dst = (uint8_t *)dst + 32; \ } \ - tmp = len; \ + tmp = (int)len; \ len = ((len - 16 + offset) & 31) + 16 - offset; \ - tmp -= len; \ + tmp -= (int)len; \ src = (const uint8_t *)src + tmp; \ dst = (uint8_t *)dst + tmp; \ } \