diff options
author | Robert Richter <robert.richter@amd.com> | 2009-06-05 09:54:24 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2009-06-11 14:15:28 -0400 |
commit | 1a245c45343651a87ff63afc5ddeb8e24d731835 (patch) | |
tree | e5722bc5147779930d7652f6daaa604530013695 /arch/x86 | |
parent | 95e74e62c1540b1115fe8cec5b592f22960f2bb2 (diff) |
x86/oprofile: remove some local variables in MSR save/restore functions
The patch removes some local variables in these functions.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/oprofile/nmi_int.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 3b84b789de0b..80b63d5db509 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -71,18 +71,16 @@ static int profile_exceptions_notify(struct notifier_block *self, | |||
71 | 71 | ||
72 | static void nmi_cpu_save_registers(struct op_msrs *msrs) | 72 | static void nmi_cpu_save_registers(struct op_msrs *msrs) |
73 | { | 73 | { |
74 | unsigned int const nr_ctrs = model->num_counters; | ||
75 | unsigned int const nr_ctrls = model->num_controls; | ||
76 | struct op_msr *counters = msrs->counters; | 74 | struct op_msr *counters = msrs->counters; |
77 | struct op_msr *controls = msrs->controls; | 75 | struct op_msr *controls = msrs->controls; |
78 | unsigned int i; | 76 | unsigned int i; |
79 | 77 | ||
80 | for (i = 0; i < nr_ctrs; ++i) { | 78 | for (i = 0; i < model->num_counters; ++i) { |
81 | if (counters[i].addr) | 79 | if (counters[i].addr) |
82 | rdmsrl(counters[i].addr, counters[i].saved); | 80 | rdmsrl(counters[i].addr, counters[i].saved); |
83 | } | 81 | } |
84 | 82 | ||
85 | for (i = 0; i < nr_ctrls; ++i) { | 83 | for (i = 0; i < model->num_controls; ++i) { |
86 | if (controls[i].addr) | 84 | if (controls[i].addr) |
87 | rdmsrl(controls[i].addr, controls[i].saved); | 85 | rdmsrl(controls[i].addr, controls[i].saved); |
88 | } | 86 | } |
@@ -191,18 +189,16 @@ static int nmi_setup(void) | |||
191 | 189 | ||
192 | static void nmi_restore_registers(struct op_msrs *msrs) | 190 | static void nmi_restore_registers(struct op_msrs *msrs) |
193 | { | 191 | { |
194 | unsigned int const nr_ctrs = model->num_counters; | ||
195 | unsigned int const nr_ctrls = model->num_controls; | ||
196 | struct op_msr *counters = msrs->counters; | 192 | struct op_msr *counters = msrs->counters; |
197 | struct op_msr *controls = msrs->controls; | 193 | struct op_msr *controls = msrs->controls; |
198 | unsigned int i; | 194 | unsigned int i; |
199 | 195 | ||
200 | for (i = 0; i < nr_ctrls; ++i) { | 196 | for (i = 0; i < model->num_controls; ++i) { |
201 | if (controls[i].addr) | 197 | if (controls[i].addr) |
202 | wrmsrl(controls[i].addr, controls[i].saved); | 198 | wrmsrl(controls[i].addr, controls[i].saved); |
203 | } | 199 | } |
204 | 200 | ||
205 | for (i = 0; i < nr_ctrs; ++i) { | 201 | for (i = 0; i < model->num_counters; ++i) { |
206 | if (counters[i].addr) | 202 | if (counters[i].addr) |
207 | wrmsrl(counters[i].addr, counters[i].saved); | 203 | wrmsrl(counters[i].addr, counters[i].saved); |
208 | } | 204 | } |