diff options
author | Nicolas Pitre <nico@fluxnic.net> | 2010-12-20 06:29:32 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-12-20 18:07:35 +0100 |
commit | b8da46d3d55807037b58f14621a0949f18053bde (patch) | |
tree | 6c3e9f15d0002b571194e0330b0c381b534c61b2 /arch/mn10300/kernel/time.c | |
parent | Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/ke... (diff) | |
download | linux-b8da46d3d55807037b58f14621a0949f18053bde.tar.xz linux-b8da46d3d55807037b58f14621a0949f18053bde.zip |
clarify a usage constraint for cnt32_to_63()
The cnt32_to_63 algorithm relies on proper counter data evaluation
ordering to work properly. This was missing from the provided
documentation.
Let's augment the documentation with the missing usage constraint and
fix the only instance that got it wrong.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mn10300/kernel/time.c')
-rw-r--r-- | arch/mn10300/kernel/time.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/mn10300/kernel/time.c b/arch/mn10300/kernel/time.c index f860a340acc9..75da468090b9 100644 --- a/arch/mn10300/kernel/time.c +++ b/arch/mn10300/kernel/time.c @@ -40,21 +40,17 @@ unsigned long long sched_clock(void) unsigned long long ll; unsigned l[2]; } tsc64, result; - unsigned long tsc, tmp; + unsigned long tmp; unsigned product[3]; /* 96-bit intermediate value */ /* cnt32_to_63() is not safe with preemption */ preempt_disable(); - /* read the TSC value - */ - tsc = get_cycles(); - - /* expand to 64-bits. + /* expand the tsc to 64-bits. * - sched_clock() must be called once a minute or better or the * following will go horribly wrong - see cnt32_to_63() */ - tsc64.ll = cnt32_to_63(tsc) & 0x7fffffffffffffffULL; + tsc64.ll = cnt32_to_63(get_cycles()) & 0x7fffffffffffffffULL; preempt_enable(); |