diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-11-26 14:45:14 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-11-26 14:45:14 +0000 |
commit | a9dc8d31d89fce894db942badcea6ec249622195 (patch) | |
tree | 02745bd91ae222ef92844aefcf52dcbd374bd5dc /sys/arch/arm | |
parent | 4b57639b221cd0dda53a3d368a76519b19811fa7 (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/arm')
-rw-r--r-- | sys/arch/arm/arm/cpu.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/arch/arm/arm/cpu.c b/sys/arch/arm/arm/cpu.c index f62b2a62fd5..8c0125cf94d 100644 --- a/sys/arch/arm/arm/cpu.c +++ b/sys/arch/arm/arm/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.55 2021/03/25 04:12:00 jsg Exp $ */ +/* $OpenBSD: cpu.c,v 1.56 2021/11/26 14:45:13 jsg Exp $ */ /* $NetBSD: cpu.c,v 1.56 2004/04/14 04:01:49 bsh Exp $ */ @@ -349,14 +349,11 @@ cpu_attach(struct device *parent, struct device *dev, void *aux) __asm volatile("mrc p15, 0, %0, c0, c0, 5" : "=r"(mpidr)); KASSERT(faa->fa_nreg > 0); +#ifdef MULTIPROCESSOR if (faa->fa_reg[0].addr == (mpidr & MPIDR_AFF)) { ci = &cpu_info_primary; -#ifdef MULTIPROCESSOR ci->ci_flags |= CPUF_RUNNING | CPUF_PRESENT | CPUF_PRIMARY; -#endif - } -#ifdef MULTIPROCESSOR - else { + } else { ci = malloc(sizeof(*ci), M_DEVBUF, M_WAITOK | M_ZERO); cpu_info[dev->dv_unit] = ci; ci->ci_next = cpu_info_list->ci_next; @@ -364,6 +361,8 @@ cpu_attach(struct device *parent, struct device *dev, void *aux) ci->ci_flags |= CPUF_AP; ncpus++; } +#else + ci = &cpu_info_primary; #endif ci->ci_dev = dev; |