perf/x86/intel: Prevent some shift wrapping bugs in the Intel uncore driver
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 18 May 2013 18:34:52 +0000 (21:34 +0300)
committerIngo Molnar <mingo@kernel.org>
Tue, 28 May 2013 07:13:52 +0000 (09:13 +0200)
commit1a2e5d292bcfbf33f9de9da7fdc750ec94c1d333
tree32087915e4a5fc93333bea87590dc109bd833d78
parent8d29820990aa4b6b0b90eed81eb038a9298f648e
perf/x86/intel: Prevent some shift wrapping bugs in the Intel uncore driver

We're trying to use 64 bit masks but the shifts wrap so we can't use the
high 32 bits. I've fixed this by changing several types to unsigned
long long.

This is a static checker fix.  The one change which is clearly needed is
"mask = 0xff << (idx * 8);" where the author obviously intended to use
all 64 bits.  The other changes are mostly to silence my static checker.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20130518183452.GA14587@elgon.mountain
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event_intel_uncore.c
arch/x86/kernel/cpu/perf_event_intel_uncore.h