From: Atsushi Nemoto Date: Tue, 23 Oct 2007 12:51:19 +0000 (+0900) Subject: [MIPS] time: Fix cevt-r4k.c for 64-bit kernel X-Git-Tag: v2.6.24-rc2~95^2~14 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c637fecb4fe67e2baccef24b9b7e9cb79ee23cf8;p=linux-2.6 [MIPS] time: Fix cevt-r4k.c for 64-bit kernel The expression "(long)(read_c0_count() - cnt)" can never be a negative value on 64-bit kernel. Cast to "int" before comparison. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c index cb46b02e02..7274fd2513 100644 --- a/arch/mips/kernel/cevt-r4k.c +++ b/arch/mips/kernel/cevt-r4k.c @@ -28,7 +28,7 @@ static int mips_next_event(unsigned long delta, cnt = read_c0_count(); cnt += delta; write_c0_compare(cnt); - res = ((long)(read_c0_count() - cnt ) > 0) ? -ETIME : 0; + res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0; #ifdef CONFIG_MIPS_MT_SMTC evpe(vpflags); local_irq_restore(flags); @@ -196,7 +196,7 @@ static int c0_compare_int_usable(void) cnt += delta; write_c0_compare(cnt); - while ((long)(read_c0_count() - cnt) <= 0) + while ((int)(read_c0_count() - cnt) <= 0) ; /* Wait for expiry */ if (!c0_compare_int_pending())