Skip to content

Commit

Permalink
x86: udelay: Use this_cpu_read to avoid address calculation
Browse files Browse the repository at this point in the history
The code will use a segment prefix instead of doing the lookup and
calculation.

Signed-off-by: Christoph Lameter <cl@linux.com>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Christoph Lameter authored and Tejun Heo committed Jan 4, 2011
1 parent c1955b5 commit 357089f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ inline void __const_udelay(unsigned long xloops)
asm("mull %%edx"
:"=d" (xloops), "=&a" (d0)
:"1" (xloops), "0"
(cpu_data(raw_smp_processor_id()).loops_per_jiffy * (HZ/4)));
(this_cpu_read(cpu_info.loops_per_jiffy) * (HZ/4)));

__delay(++xloops);
}
Expand Down

0 comments on commit 357089f

Please sign in to comment.