[dpdk-dev,1/3] eal: add const in prefetch functions
diff mbox

Message ID 1411036471-3822-2-git-send-email-pablo.de.lara.guarch@intel.com
State Rejected, archived
Headers show

Commit Message

De Lara Guarch, Pablo Sept. 18, 2014, 10:34 a.m. UTC
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 <pablo.de.lara.guarch@intel.com>
---
 lib/librte_eal/common/include/rte_prefetch.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Patch
diff mbox

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