Skip to content

Commit

Permalink
sh: Fix underflow in SH udelay() code.
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Stuart Menefy authored and Paul Mundt committed Aug 24, 2009
1 parent 6d243dd commit bd4fb4d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/sh/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ void __delay(unsigned long loops)

inline void __const_udelay(unsigned long xloops)
{
xloops *= 4;
__asm__("dmulu.l %0, %2\n\t"
"sts mach, %0"
: "=r" (xloops)
: "0" (xloops),
"r" (HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy)
"r" (cpu_data[raw_smp_processor_id()].loops_per_jiffy * (HZ/4))
: "macl", "mach");
__delay(xloops);
__delay(++xloops);
}

void __udelay(unsigned long usecs)
Expand Down

0 comments on commit bd4fb4d

Please sign in to comment.