[patch 3/4] x86,perf: P4 PMU -- Get rid of redundant check for array index
From: Cyrill Gorcunov
Date: Sat May 08 2010 - 07:27:39 EST
The caller already has done such a check.
And it was wrong anyway, it had to be '>=' rather then '>'
CC: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CC: Ingo Molnar <mingo@xxxxxxx>
CC: Frederic Weisbecker <fweisbec@xxxxxxxxx>
CC: Lin Ming <ming.m.lin@xxxxxxxxx>
Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
---
arch/x86/kernel/cpu/perf_event_p4.c | 5 -----
1 file changed, 5 deletions(-)
Index: linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event_p4.c
+++ linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
@@ -406,11 +406,6 @@ static u64 p4_pmu_event_map(int hw_event
unsigned int esel;
u64 config;
- if (hw_event > ARRAY_SIZE(p4_general_events)) {
- printk_once(KERN_ERR "P4 PMU: Bad index: %i\n", hw_event);
- return 0;
- }
-
config = p4_general_events[hw_event];
bind = p4_config_get_bind(config);
esel = P4_OPCODE_ESEL(bind->opcode);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/