Skip to content

Commit

Permalink
x86, perf: P4 PMU -- Get rid of redundant check for array index
Browse files Browse the repository at this point in the history
The caller already has done such a check.
And it was wrong anyway, it had to be '>=' rather than '>'

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Lin Ming <ming.m.lin@intel.com>
LKML-Reference: <20100508112717.130386882@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Cyrill Gorcunov authored and Ingo Molnar committed May 8, 2010
1 parent 137351e commit 3f51b71
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions arch/x86/kernel/cpu/perf_event_p4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3f51b71

Please sign in to comment.