]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
arch/x86/kernel/cpu/perf_event_msr.c: use sign_extend64() for sign extension
authorMartin Kepplinger <martink@posteo.de>
Sat, 7 Nov 2015 00:31:08 +0000 (16:31 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Nov 2015 01:50:42 +0000 (17:50 -0800)
Signed-off-by: Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: George Spelvin <linux@horizon.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/kernel/cpu/perf_event_msr.c

index f32ac13934f2310c1b61f54884246089c7e06e01..ec863b9a9f780c7507634353d64f9c2f76f1a0e1 100644 (file)
@@ -163,10 +163,9 @@ again:
                goto again;
 
        delta = now - prev;
-       if (unlikely(event->hw.event_base == MSR_SMI_COUNT)) {
-               delta <<= 32;
-               delta >>= 32; /* sign extend */
-       }
+       if (unlikely(event->hw.event_base == MSR_SMI_COUNT))
+               delta = sign_extend64(delta, 31);
+
        local64_add(now - prev, &event->count);
 }