summaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel/time.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@fluxnic.net>2010-12-20 00:29:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-12-20 09:07:35 -0800
commitb8da46d3d55807037b58f14621a0949f18053bde (patch)
tree6c3e9f15d0002b571194e0330b0c381b534c61b2 /arch/mn10300/kernel/time.c
parentde5e9d58200aafea4a33abcadcd12eb69eaba5c4 (diff)
downloadop-kernel-dev-b8da46d3d55807037b58f14621a0949f18053bde.zip
op-kernel-dev-b8da46d3d55807037b58f14621a0949f18053bde.tar.gz
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.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/mn10300/kernel/time.c b/arch/mn10300/kernel/time.c
index f860a34..75da468 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();
OpenPOWER on IntegriCloud