From e5ddf3a68a255c528b2179e834ce44db0fd531cc Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Fri, 14 May 2010 23:08:15 +0400 Subject: [PATCH] --- yaml --- r: 191359 b: refs/heads/master c: 1ff3d7d79204612ebe2e611d2592f8898908ca00 h: refs/heads/master i: 191357: e772e6ff7aa4aaaf0540f3a02d9fc748999d0be2 191355: 60f697b805f50bde1d1485d7f18b7e287042175e 191351: ead1359cec5619139a3496741657148052a62526 191343: 24e299f8c6631d3a52a252828dd125e231bced79 191327: cfb369db0c75108795910fc91d3af0ffc2edad99 191295: 0d5e83c79668300bf3b3b88247b9d6dfcda2528e 191231: 296ac94f2f54879f2eef138c0d784662292c2c68 v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/cpu/perf_event_p4.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 2e0c4cb46ed9..976436d09245 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5d2be7cb198a0a6bc6088d3806fb7261b184ad89 +refs/heads/master: 1ff3d7d79204612ebe2e611d2592f8898908ca00 diff --git a/trunk/arch/x86/kernel/cpu/perf_event_p4.c b/trunk/arch/x86/kernel/cpu/perf_event_p4.c index cb875b1e2e87..424fc8de68e4 100644 --- a/trunk/arch/x86/kernel/cpu/perf_event_p4.c +++ b/trunk/arch/x86/kernel/cpu/perf_event_p4.c @@ -18,7 +18,7 @@ struct p4_event_bind { unsigned int opcode; /* Event code and ESCR selector */ unsigned int escr_msr[2]; /* ESCR MSR for this event */ - unsigned char cntr[2][P4_CNTR_LIMIT]; /* counter index (offset), -1 on abscence */ + char cntr[2][P4_CNTR_LIMIT]; /* counter index (offset), -1 on abscence */ }; struct p4_cache_event_bind { @@ -747,11 +747,11 @@ static int p4_get_escr_idx(unsigned int addr) static int p4_next_cntr(int thread, unsigned long *used_mask, struct p4_event_bind *bind) { - int i = 0, j; + int i, j; for (i = 0; i < P4_CNTR_LIMIT; i++) { - j = bind->cntr[thread][i++]; - if (j == -1 || !test_bit(j, used_mask)) + j = bind->cntr[thread][i]; + if (j != -1 && !test_bit(j, used_mask)) return j; }