[dpdk-dev,1/3] eal: add const in prefetch functions
Commit Message
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(-)
@@ -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