summaryrefslogtreecommitdiffstats
path: root/arch/openrisc/lib/delay.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-13 11:25:41 +0900
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-13 11:25:41 +0900
commit18a022de47bc11ee20d7d0f4dd72d42d2cfdc51c (patch)
tree84e178e4e475400f8e9a5c74f1e2cb35ee17fca4 /arch/openrisc/lib/delay.c
parent02a650e2820e19fde8f6a49752027217fdd33d78 (diff)
parentd23b5799b608112bb799c9b0e1e11ee1da692d76 (diff)
Merge tag 'for-3.7' of git://openrisc.net/jonas/linux
Pull OpenRISC updates from Jonas Bonn: "Fixups for some corner cases, build issues, and some obvious bugs in IRQ handling. No major changes." * tag 'for-3.7' of git://openrisc.net/jonas/linux: openrisc: mask interrupts in irq_mask_ack function openrisc: fix typos in comments and warnings openrisc: PIC should act on domain-local irqs openrisc: Make cpu_relax() invoke barrier() audit: define AUDIT_ARCH_OPENRISC openrisc: delay: fix handling of counter overflow openrisc: delay: fix loops calculation for __const_udelay
Diffstat (limited to 'arch/openrisc/lib/delay.c')
-rw-r--r--arch/openrisc/lib/delay.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/openrisc/lib/delay.c b/arch/openrisc/lib/delay.c
index 01d9740ae6f..c330767c921 100644
--- a/arch/openrisc/lib/delay.c
+++ b/arch/openrisc/lib/delay.c
@@ -30,9 +30,9 @@ int __devinit read_current_timer(unsigned long *timer_value)
void __delay(unsigned long cycles)
{
- cycles_t target = get_cycles() + cycles;
+ cycles_t start = get_cycles();
- while (get_cycles() < target)
+ while ((get_cycles() - start) < cycles)
cpu_relax();
}
EXPORT_SYMBOL(__delay);
@@ -41,7 +41,7 @@ inline void __const_udelay(unsigned long xloops)
{
unsigned long long loops;
- loops = xloops * loops_per_jiffy * HZ;
+ loops = (unsigned long long)xloops * loops_per_jiffy * HZ;
__delay(loops >> 32);
}