From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 8A64C68C2 for ; Thu, 18 Sep 2014 12:29:03 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 18 Sep 2014 03:34:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,546,1406617200"; d="scan'208";a="593176858" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 18 Sep 2014 03:34:32 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s8IAYWNg012107 for ; Thu, 18 Sep 2014 11:34:32 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s8IAYVCP003869 for ; Thu, 18 Sep 2014 11:34:31 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id s8IAYVHx003865 for dev@dpdk.org; Thu, 18 Sep 2014 11:34:31 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Thu, 18 Sep 2014 11:34:29 +0100 Message-Id: <1411036471-3822-2-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1411036471-3822-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1411036471-3822-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH 1/3] eal: add const in prefetch functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 10:29:04 -0000 rte_prefetchX functions included volatile void *p as parameter, but the function does not modify it, so it should be const. Signed-off-by: Pablo de Lara --- lib/librte_eal/common/include/rte_prefetch.h | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/common/include/rte_prefetch.h b/lib/librte_eal/common/include/rte_prefetch.h index 8a691ef..2d59009 100644 --- a/lib/librte_eal/common/include/rte_prefetch.h +++ b/lib/librte_eal/common/include/rte_prefetch.h @@ -55,9 +55,9 @@ extern "C" { * @param p * Address to prefetch */ -static inline void rte_prefetch0(volatile void *p) +static inline void rte_prefetch0(const volatile void *p) { - asm volatile ("prefetcht0 %[p]" : [p] "+m" (*(volatile char *)p)); + asm volatile ("prefetcht0 %[p]" : : [p] "m" (*(const volatile char *)p)); } /** @@ -65,9 +65,9 @@ static inline void rte_prefetch0(volatile void *p) * @param p * Address to prefetch */ -static inline void rte_prefetch1(volatile void *p) +static inline void rte_prefetch1(const volatile void *p) { - asm volatile ("prefetcht1 %[p]" : [p] "+m" (*(volatile char *)p)); + asm volatile ("prefetcht1 %[p]" : : [p] "m" (*(const volatile char *)p)); } /** @@ -76,9 +76,9 @@ static inline void rte_prefetch1(volatile void *p) * @param p * Address to prefetch */ -static inline void rte_prefetch2(volatile void *p) +static inline void rte_prefetch2(const volatile void *p) { - asm volatile ("prefetcht2 %[p]" : [p] "+m" (*(volatile char *)p)); + asm volatile ("prefetcht2 %[p]" : : [p] "m" (*(const volatile char *)p)); } #ifdef __cplusplus -- 1.7.7.6