* [PATCH] Fix cevt-r4k.c for 64-bit kernel
@ 2007-10-23 12:51 Atsushi Nemoto
2007-10-28 23:50 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2007-10-23 12:51 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
The expression "(long)(read_c0_count() - cnt)" never be a negative
value on 64-bit kernel. Cast to "int" before comparison.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
arch/mips/kernel/cevt-r4k.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index ae2984f..47c8c0e 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())
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-29 11:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-23 12:51 [PATCH] Fix cevt-r4k.c for 64-bit kernel Atsushi Nemoto
2007-10-28 23:50 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox