Fix mdelay(1) for 64bit kernel with HZ == 1000
commitcf57b805a4473853def078d1fa9868433b465656
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Wed, 30 Nov 2005 04:33:26 +0000 (30 13:33 +0900)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 5 Dec 2005 14:35:07 +0000 (5 14:35 +0000)
tree0000d464f397371beee03a4438ad5e79e3a79372
parent66e1ab2273429df78184e6d4320da31a6b716ac1
Fix mdelay(1) for 64bit kernel with HZ == 1000

mdelay(1) (i.e. udelay(1000)) does not work correctly due to overflow.

1000 * 0x004189374BC6A7f0 = 0x10000000000000180 (>= 2**64)

0x004189374BC6A7ef (0x004189374BC6A7f0 - 1) is OK and it is exactly
same as catchall case (0x8000000000000000UL / (500000 / HZ)).

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
include/asm-mips/delay.h