diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-06-06 15:04:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-06 15:09:08 -0400 |
commit | 8953645fec933f992223286ad407dc371ac2caa5 (patch) | |
tree | e2054022b338a4d85a3e3de7a90194b52431ff31 /tools/perf/util | |
parent | 7d37a0cbd68c875fa984fa97bcf5c7f4b7950b6d (diff) |
perf_counter tools: Fix error condition in parse_aliases()
gcc warned about this bug:
util/parse-events.c: In function ‘parse_generic_hw_symbols’:
util/parse-events.c:175: warning: comparison is always false due to limited range of data type
util/parse-events.c:182: warning: comparison is always false due to limited range of data type
util/parse-events.c:190: warning: comparison is always false due to limited range of data type
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/parse-events.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index e0820b4388ae..f18a9a006e1b 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -160,12 +160,12 @@ static int parse_aliases(const char *str, char *names[][MAX_ALIASES], int size) | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | return 0; | 163 | return -1; |
164 | } | 164 | } |
165 | 165 | ||
166 | static int parse_generic_hw_symbols(const char *str, struct perf_counter_attr *attr) | 166 | static int parse_generic_hw_symbols(const char *str, struct perf_counter_attr *attr) |
167 | { | 167 | { |
168 | __u8 cache_type = -1, cache_op = 0, cache_result = 0; | 168 | int cache_type = -1, cache_op = 0, cache_result = 0; |
169 | 169 | ||
170 | cache_type = parse_aliases(str, hw_cache, PERF_COUNT_HW_CACHE_MAX); | 170 | cache_type = parse_aliases(str, hw_cache, PERF_COUNT_HW_CACHE_MAX); |
171 | /* | 171 | /* |
@@ -179,8 +179,8 @@ static int parse_generic_hw_symbols(const char *str, struct perf_counter_attr *a | |||
179 | /* | 179 | /* |
180 | * Fall back to reads: | 180 | * Fall back to reads: |
181 | */ | 181 | */ |
182 | if (cache_type == -1) | 182 | if (cache_op == -1) |
183 | cache_type = PERF_COUNT_HW_CACHE_OP_READ; | 183 | cache_op = PERF_COUNT_HW_CACHE_OP_READ; |
184 | 184 | ||
185 | cache_result = parse_aliases(str, hw_cache_result, | 185 | cache_result = parse_aliases(str, hw_cache_result, |
186 | PERF_COUNT_HW_CACHE_RESULT_MAX); | 186 | PERF_COUNT_HW_CACHE_RESULT_MAX); |