]> git.karo-electronics.de Git - karo-tx-linux.git/commit
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)
commit13acac307528c9cd7dd9fa9c577419401527b464
tree32087915e4a5fc93333bea87590dc109bd833d78
parent62b8563979273424d6ebe9201e34d1acc133ad4f
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