aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/cpu/perf_event.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 2c22ce4fa784..33c889ff21ae 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1245,9 +1245,9 @@ static inline int is_x86_event(struct perf_event *event)
1245 1245
1246static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign) 1246static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
1247{ 1247{
1248 int i, j, w, num, wmax;
1249 struct event_constraint *c, *constraints[X86_PMC_IDX_MAX]; 1248 struct event_constraint *c, *constraints[X86_PMC_IDX_MAX];
1250 unsigned long used_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; 1249 unsigned long used_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
1250 int i, j, w, wmax, num = 0;
1251 struct hw_perf_event *hwc; 1251 struct hw_perf_event *hwc;
1252 1252
1253 bitmap_zero(used_mask, X86_PMC_IDX_MAX); 1253 bitmap_zero(used_mask, X86_PMC_IDX_MAX);
@@ -1260,7 +1260,7 @@ static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
1260 /* 1260 /*
1261 * fastpath, try to reuse previous register 1261 * fastpath, try to reuse previous register
1262 */ 1262 */
1263 for (i = 0, num = n; i < n; i++, num--) { 1263 for (i = 0; i < n; i++) {
1264 hwc = &cpuc->event_list[i]->hw; 1264 hwc = &cpuc->event_list[i]->hw;
1265 c = constraints[i]; 1265 c = constraints[i];
1266 1266
@@ -1288,7 +1288,7 @@ static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
1288 if (assign) 1288 if (assign)
1289 assign[i] = hwc->idx; 1289 assign[i] = hwc->idx;
1290 } 1290 }
1291 if (!num) 1291 if (i == n)
1292 goto done; 1292 goto done;
1293 1293
1294 /* 1294 /*