From 08f6690bbee735c337e289e3ccea0b8f342f4b44 Mon Sep 17 00:00:00 2001 From: visa Date: Tue, 20 Jul 2021 07:53:39 +0000 Subject: [PATCH] Remove bogus use of CPU_MAXID and get cpu_info only once. --- sys/arch/mips64/mips64/ipifuncs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/arch/mips64/mips64/ipifuncs.c b/sys/arch/mips64/mips64/ipifuncs.c index d7f73a056c6..c23a12948d4 100644 --- a/sys/arch/mips64/mips64/ipifuncs.c +++ b/sys/arch/mips64/mips64/ipifuncs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipifuncs.c,v 1.22 2020/08/10 15:22:53 visa Exp $ */ +/* $OpenBSD: ipifuncs.c,v 1.23 2021/07/20 07:53:39 visa Exp $ */ /* $NetBSD: ipifuncs.c,v 1.40 2008/04/28 20:23:10 martin Exp $ */ /*- @@ -126,9 +126,11 @@ static void do_send_ipi(unsigned int cpuid, unsigned int ipimask) { #ifdef DEBUG - if (cpuid >= CPU_MAXID || get_cpu_info(cpuid) == NULL) + struct cpu_info *ci = get_cpu_info(cpuid); + + if (ci == NULL) panic("mips_send_ipi: bogus cpu_id"); - if (!cpuset_isset(&cpus_running, get_cpu_info(cpuid))) + if (!cpuset_isset(&cpus_running, ci)) panic("mips_send_ipi: CPU %u not running", cpuid); #endif -- 2.20.1