From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 3/7] powerpc/setup: define cpu_pvr at all time
Date: Fri, 22 Mar 2019 08:08:41 +0000 (UTC) [thread overview]
Message-ID: <a3188807e85a5e0f8952d3470d9da7504bfd3e14.1553242059.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <a2ac33258063682558fe0cac8eedcbd28aa4a141.1553242059.git.christophe.leroy@c-s.fr>
To avoid ifdefs, define cpu_pvr at all time.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.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
next prev parent reply other threads:[~2019-03-22 8:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-22 8:08 [PATCH 1/7] powerpc/fadump: define an empty fadump_cleanup() Christophe Leroy
2019-03-22 8:08 ` [PATCH 2/7] powerpc/mm: define an empty mm_iommu_init() Christophe Leroy
2019-03-22 8:08 ` Christophe Leroy [this message]
2019-03-26 6:13 ` [PATCH 3/7] powerpc/setup: define cpu_pvr at all time Christophe Leroy
2019-03-22 8:08 ` [PATCH 4/7] powerpc/setup: Remove unnecessary #ifdef CONFIG_ALTIVEC Christophe Leroy
2019-03-22 8:08 ` [PATCH 5/7] powerpc/setup: cleanup ifdef mess in check_cache_coherency() Christophe Leroy
2019-03-22 8:08 ` [PATCH 6/7] powerpc/setup: cleanup the #ifdef CONFIG_TAU block Christophe Leroy
2019-03-22 8:08 ` [PATCH 7/7] powerpc/setup: replace ifdefs by IS_ENABLED() wherever possible Christophe Leroy
2019-05-03 6:59 ` [PATCH 1/7] powerpc/fadump: define an empty fadump_cleanup() Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a3188807e85a5e0f8952d3470d9da7504bfd3e14.1553242059.git.christophe.leroy@c-s.fr \
--to=christophe.leroy@c-s.fr \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).