Skip to contentSkip to conversation

perf tools: use ansi versions of asm and volatile

PATCH Superseded Ramkumar Ramachandra 2 participants 4 messages Oct 15, 2013 perf events

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: use ansi versions of asm and volatile

asm and volatile are provided for backward compatibility; use the ansi versions __asm__ and __volatile__.

Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/tests/rdpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/rdpmc.c +1 -1
index ff94886..a05be61 100644
@@ -9,7 +9,7 @@
 
 #if defined(__x86_64__) || defined(__i386__)
 
-#define barrier() asm volatile("" ::: "memory")
+#define barrier() __asm__ __volatile__("" ::: "memory")
 
 static u64 rdpmc(unsigned int counter)
 {
Signature · 1 line
1.8.4.477.g5d89aa9
maintainer
#1 lore raw
Quoted 3 lines · Ramkumar Ramachandra

asm and volatile are provided for backward compatibility; use the ansi versions __asm__ and __volatile__.

I won't object much to this; but I have to note that the entire kernel tree is loaded with the non-ansi variant and thus we're fairly certain it will continue working :-)

#2 lore raw
Quoted 8 lines · Peter Zijlstra
Quoted 3 lines · Ramkumar Ramachandra

asm and volatile are provided for backward compatibility; use the ansi versions __asm__ and __volatile__.

I won't object much to this; but I have to note that the entire kernel tree is loaded with the non-ansi variant and thus we're fairly certain it will continue working :-)

Oh well, atleast the definition of barrier() is consistent with the one in linux/compiler-gcc.h.

maintainer
#3 lore raw
In reply to Ramkumar Ramachandra
Quoted 2 lines · Ramkumar Ramachandra

asm and volatile are provided for backward compatibility; use the ansi versions __asm__ and __volatile__.

Also, you seem to have 'forgotten' to convert the 31 other instances :-)

# git grep -E "[[:space:]]asm[([:space:]]" tools/perf/ | wc -l
32