[PATCH 3/7] powerpc/setup: define cpu_pvr at all time

From: Christophe Leroy
Date: Fri Mar 22 2019 - 04:08:49 EST


To avoid ifdefs, define cpu_pvr at all time.

Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxx>
---
arch/powerpc/kernel/setup-common.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index a90e8367ccde..a4ed9301e815 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -190,9 +190,7 @@ void machine_halt(void)
machine_hang();
}

-#ifdef CONFIG_SMP
DEFINE_PER_CPU(unsigned int, cpu_pvr);
-#endif

static void show_cpuinfo_summary(struct seq_file *m)
{
@@ -234,11 +232,11 @@ static int show_cpuinfo(struct seq_file *m, void *v)
unsigned short maj;
unsigned short min;

-#ifdef CONFIG_SMP
- pvr = per_cpu(cpu_pvr, cpu_id);
-#else
- pvr = mfspr(SPRN_PVR);
-#endif
+ if (IS_ENABLED(CONFIG_SMP))
+ pvr = per_cpu(cpu_pvr, cpu_id);
+ else
+ pvr = mfspr(SPRN_PVR);
+
maj = (pvr >> 8) & 0xFF;
min = pvr & 0xFF;

--
2.13.3