diff options
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_p4.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index cb875b1e2e87..424fc8de68e4 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -18,7 +18,7 @@ | |||
18 | struct p4_event_bind { | 18 | struct p4_event_bind { |
19 | unsigned int opcode; /* Event code and ESCR selector */ | 19 | unsigned int opcode; /* Event code and ESCR selector */ |
20 | unsigned int escr_msr[2]; /* ESCR MSR for this event */ | 20 | unsigned int escr_msr[2]; /* ESCR MSR for this event */ |
21 | unsigned char cntr[2][P4_CNTR_LIMIT]; /* counter index (offset), -1 on abscence */ | 21 | char cntr[2][P4_CNTR_LIMIT]; /* counter index (offset), -1 on abscence */ |
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct p4_cache_event_bind { | 24 | struct p4_cache_event_bind { |
@@ -747,11 +747,11 @@ static int p4_get_escr_idx(unsigned int addr) | |||
747 | static int p4_next_cntr(int thread, unsigned long *used_mask, | 747 | static int p4_next_cntr(int thread, unsigned long *used_mask, |
748 | struct p4_event_bind *bind) | 748 | struct p4_event_bind *bind) |
749 | { | 749 | { |
750 | int i = 0, j; | 750 | int i, j; |
751 | 751 | ||
752 | for (i = 0; i < P4_CNTR_LIMIT; i++) { | 752 | for (i = 0; i < P4_CNTR_LIMIT; i++) { |
753 | j = bind->cntr[thread][i++]; | 753 | j = bind->cntr[thread][i]; |
754 | if (j == -1 || !test_bit(j, used_mask)) | 754 | if (j != -1 && !test_bit(j, used_mask)) |
755 | return j; | 755 | return j; |
756 | } | 756 | } |
757 | 757 | ||