浏览代码

x86, perf: P4 PMU -- Get rid of redundant check for array index

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>
Cyrill Gorcunov 15 年之前
父节点
当前提交
3f51b7119d
共有 1 个文件被更改,包括 0 次插入5 次删除
  1. 0 5
      arch/x86/kernel/cpu/perf_event_p4.c

+ 0 - 5
arch/x86/kernel/cpu/perf_event_p4.c

@@ -406,11 +406,6 @@ static u64 p4_pmu_event_map(int hw_event)
 	unsigned int esel;
 	unsigned int esel;
 	u64 config;
 	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];
 	config = p4_general_events[hw_event];
 	bind = p4_config_get_bind(config);
 	bind = p4_config_get_bind(config);
 	esel = P4_OPCODE_ESEL(bind->opcode);
 	esel = P4_OPCODE_ESEL(bind->opcode);