From af43358115bd7affb8fb8584b773ded959bfdeb4 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Tue, 12 Jun 2001 23:09:46 +0000 Subject: In intr_findvec(), correct the for() loop bounds. And display barf messages only if option DIAGNOSTIC. --- sys/arch/mvme88k/mvme88k/machdep.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sys/arch/mvme88k') diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 1ff9de1ff0c..62d9648af10 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.37 2001/06/05 23:07:50 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.38 2001/06/12 23:09:45 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -1492,14 +1492,19 @@ intr_findvec(start, end) { int vec; +#ifdef DIAGNOSTIC /* Sanity check! */ if (start < 0 || end > 255 || start > end) panic("intr_findvec(): bad parameters"); - for (vec = start; vec < end; --vec){ +#endif + + for (vec = end; vec > start; --vec){ if (intr_handlers[vec] == NULL) return (vec); } +#ifdef DIAGNOSTIC printf("intr_findvec(): uh oh....\n", vec); +#endif return (-1); } -- cgit v1.2.3