aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/perf_event_intel_uncore.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-06-19 15:15:31 +0200
committerIngo Molnar <mingo@kernel.org>2014-07-05 11:21:52 +0200
commit2172c1f5aa58310784f358ca20fdddfcdc2a0d7b (patch)
tree5984b036cd43e60fc78404b9e95995284997b6e4 /arch/x86/kernel/cpu/perf_event_intel_uncore.c
parent985c8dcbe15ddd8a1b98dc6b9c6403cb5d7012ab (diff)
perf/x86: Micro-optimize nhmex_rbox_get_constraint()
Flipping the LSB doesn't require four lines of code. This shaves a few bytes of the generated code, including a branch. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1403183731-15402-1-git-send-email-linux@rasmusvillemoes.dk Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event_intel_uncore.c')
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_uncore.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index 65bbbea38b9c..e009f3cedf89 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -2946,10 +2946,7 @@ again:
* extra registers. If we failed to take an extra
* register, try the alternative.
*/
- if (idx % 2)
- idx--;
- else
- idx++;
+ idx ^= 1;
if (idx != reg1->idx % 6) {
if (idx == 2)
config1 >>= 8;