Commit c3b291d9 authored by Will Deacon's avatar Will Deacon Committed by Russell King

ARM: 6469/1: perf-events: squash compiler warning

armv7_pmnc_counter_has_overflowed can return uninitialised data
if an invalid counter is specified.

This patch fixes the code to return 0 in this case, which squashes
the compiler warning from GCC 4.5.
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent d33aadbf
...@@ -1749,7 +1749,7 @@ static inline int armv7_pmnc_has_overflowed(unsigned long pmnc) ...@@ -1749,7 +1749,7 @@ static inline int armv7_pmnc_has_overflowed(unsigned long pmnc)
static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc, static inline int armv7_pmnc_counter_has_overflowed(unsigned long pmnc,
enum armv7_counters counter) enum armv7_counters counter)
{ {
int ret; int ret = 0;
if (counter == ARMV7_CYCLE_COUNTER) if (counter == ARMV7_CYCLE_COUNTER)
ret = pmnc & ARMV7_FLAG_C; ret = pmnc & ARMV7_FLAG_C;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment