[PATCHv5 1/3] ARM: Translate delay.S into (mostly) C

Mattias Wallin mattias.wallin at stericsson.com
Wed Apr 6 04:49:20 EDT 2011


On 04/06/2011 01:56 AM, Stephen Boyd wrote:
> +void __udelay(unsigned long usecs)
> +{
> +	__const_udelay(usecs * ((2199023*HZ)>>11));
This will overflow if HZ=1000.
If I remember correct I fixed it like this:
__const_udelay(usecs * ((2199023UL*HZ)>>11));

/Mattias Wallin



More information about the linux-arm-kernel mailing list