[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a3188807e85a5e0f8952d3470d9da7504bfd3e14.1553242059.git.christophe.leroy@c-s.fr>
Date: Fri, 22 Mar 2019 08:08:41 +0000 (UTC)
From: Christophe Leroy <christophe.leroy@....fr>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: [PATCH 3/7] powerpc/setup: define cpu_pvr at all time
To avoid ifdefs, define cpu_pvr at all time.
Signed-off-by: Christophe Leroy <christophe.leroy@....fr>
---
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
Powered by blists - more mailing lists