summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2021-11-26 14:45:14 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2021-11-26 14:45:14 +0000
commita9dc8d31d89fce894db942badcea6ec249622195 (patch)
tree02745bd91ae222ef92844aefcf52dcbd374bd5dc /sys/arch/mips64
parent4b57639b221cd0dda53a3d368a76519b19811fa7 (diff)
avoid clang -Wsometimes-uninitialized warning when MULTIPROCESSOR is not
defined feedback from millert@, ok kettenis@, mips64 diff from and ok visa@
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/cpu.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c
index 9b818c040c3..60387228fa9 100644
--- a/sys/arch/mips64/mips64/cpu.c
+++ b/sys/arch/mips64/mips64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.80 2021/07/24 08:21:13 visa Exp $ */
+/* $OpenBSD: cpu.c,v 1.81 2021/11/26 14:45:13 jsg Exp $ */
/*
* Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se)
@@ -83,9 +83,9 @@ cpuattach(struct device *parent, struct device *dev, void *aux)
int fptype, vers_maj, vers_min;
int displayver;
+#ifdef MULTIPROCESSOR
if (cpuno == 0) {
ci = &cpu_info_primary;
-#ifdef MULTIPROCESSOR
ci->ci_flags |= CPUF_RUNNING | CPUF_PRESENT | CPUF_PRIMARY;
if (ncpusfound > 1) {
cpu_info_secondaries = (struct cpu_info *)
@@ -94,15 +94,14 @@ cpuattach(struct device *parent, struct device *dev, void *aux)
if (cpu_info_secondaries == NULL)
panic("unable to allocate cpu_info");
}
-#endif
- }
-#ifdef MULTIPROCESSOR
- else {
+ } else {
ci = &cpu_info_secondaries[cpuno - 1];
ci->ci_next = cpu_info_list->ci_next;
cpu_info_list->ci_next = ci;
ci->ci_flags |= CPUF_PRESENT;
}
+#else
+ ci = &cpu_info_primary;
#endif
ci->ci_self = ci;
ci->ci_cpuid = cpuno;