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 at intel.com>
---
 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

Reply via email to