From: Peter Zijlstra <peterz@infradead.org>
To: Jaswinder Singh Rajput <jaswinder@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
x86 maintainers <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [git-pull -tip] x86:perf_counter cleanup
Date: Sun, 08 Mar 2009 11:34:19 +0100 [thread overview]
Message-ID: <1236508459.22914.3645.camel@twins> (raw)
In-Reply-To: <1236507232.28127.2.camel@localhost.localdomain>
An actual cleanup would be:
---
Subject: perf_counters: cleanup amd64 code a little
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
Date: Thu Mar 05 21:18:49 CET 2009
Use and actual unsigned long bitmap instead of casting our way around.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
arch/x86/kernel/cpu/perf_counter.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-2.6/arch/x86/kernel/cpu/perf_counter.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/perf_counter.c
+++ linux-2.6/arch/x86/kernel/cpu/perf_counter.c
@@ -37,7 +37,7 @@ struct cpu_hw_counters {
unsigned long used[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
unsigned long interrupts;
u64 throttle_ctrl;
- u64 active_mask;
+ unsigned long active_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
int enabled;
};
@@ -291,7 +291,7 @@ static void pmc_amd_restore_all(u64 ctrl
return;
for (idx = 0; idx < nr_counters_generic; idx++) {
- if (test_bit(idx, (unsigned long *)&cpuc->active_mask)) {
+ if (test_bit(idx, cpuc->active_mask)) {
u64 val;
rdmsrl(MSR_K7_EVNTSEL0 + idx, val);
@@ -377,7 +377,7 @@ static void pmc_amd_enable(int idx, u64
{
struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
- set_bit(idx, (unsigned long *)&cpuc->active_mask);
+ set_bit(idx, cpuc->active_mask);
if (cpuc->enabled)
config |= ARCH_PERFMON_EVENTSEL0_ENABLE;
@@ -401,7 +401,7 @@ static void pmc_amd_disable(int idx, u64
{
struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
- clear_bit(idx, (unsigned long *)&cpuc->active_mask);
+ clear_bit(idx, cpuc->active_mask);
wrmsrl(MSR_K7_EVNTSEL0 + idx, config);
}
next prev parent reply other threads:[~2009-03-08 10:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-08 10:13 [git-pull -tip] x86:perf_counter cleanup Jaswinder Singh Rajput
2009-03-08 10:20 ` Peter Zijlstra
2009-03-08 10:39 ` Jaswinder Singh Rajput
2009-03-08 10:41 ` Ingo Molnar
2009-03-08 11:39 ` Jaswinder Singh Rajput
2009-03-08 10:46 ` Peter Zijlstra
2009-03-08 10:32 ` Peter Zijlstra
2009-03-08 10:34 ` Peter Zijlstra [this message]
2009-03-08 15:52 ` [tip:perfcounters/core] x86: perf_counter cleanup Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1236508459.22914.3645.camel@twins \
--to=peterz@infradead.org \
--cc=jaswinder@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.