diff options
author | Robert Richter <robert.richter@amd.com> | 2009-07-08 08:54:17 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2009-07-20 10:43:18 -0400 |
commit | 5e766e3e433fa2d5d2fdfd8e2432804c91393387 (patch) | |
tree | 8b78cc516709a00ef28b67063e525c14de027eda /arch/x86/oprofile | |
parent | 4d4036e0e7299c6cbb2d2421b4b30b7a409ce61a (diff) |
x86/oprofile: Fix usage of NUM_CONTROLS/NUM_COUNTERS macros
Use the corresponding macros when iterating over counter and control
registers. Since NUM_CONTROLS and NUM_COUNTERS are equal for AMD cpus
the fix is more a cosmetical change.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r-- | arch/x86/oprofile/op_model_amd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c index fdbed3a0c877..dcfd4505cacc 100644 --- a/arch/x86/oprofile/op_model_amd.c +++ b/arch/x86/oprofile/op_model_amd.c | |||
@@ -99,7 +99,7 @@ static void op_amd_fill_in_addresses(struct op_msrs * const msrs) | |||
99 | 99 | ||
100 | #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX | 100 | #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX |
101 | for (i = 0; i < NUM_VIRT_COUNTERS; i++) { | 101 | for (i = 0; i < NUM_VIRT_COUNTERS; i++) { |
102 | int hw_counter = i % NUM_CONTROLS; | 102 | int hw_counter = i % NUM_COUNTERS; |
103 | if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i)) | 103 | if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i)) |
104 | msrs->multiplex[i].addr = MSR_K7_PERFCTR0 + hw_counter; | 104 | msrs->multiplex[i].addr = MSR_K7_PERFCTR0 + hw_counter; |
105 | else | 105 | else |
@@ -366,7 +366,7 @@ static void op_amd_shutdown(struct op_msrs const * const msrs) | |||
366 | if (msrs->counters[i].addr) | 366 | if (msrs->counters[i].addr) |
367 | release_perfctr_nmi(MSR_K7_PERFCTR0 + i); | 367 | release_perfctr_nmi(MSR_K7_PERFCTR0 + i); |
368 | } | 368 | } |
369 | for (i = 0; i < NUM_COUNTERS; ++i) { | 369 | for (i = 0; i < NUM_CONTROLS; ++i) { |
370 | if (msrs->controls[i].addr) | 370 | if (msrs->controls[i].addr) |
371 | release_evntsel_nmi(MSR_K7_EVNTSEL0 + i); | 371 | release_evntsel_nmi(MSR_K7_EVNTSEL0 + i); |
372 | } | 372 | } |