lkml.org 
[lkml]   [2019]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/7] powerpc/setup: define cpu_pvr at all time
From
Date


Le 22/03/2019 à 09:08, Christophe Leroy a écrit :
> To avoid ifdefs, define cpu_pvr at all time.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

This patch introduces a sparse warning.

I guess we can skip it for now and rework more deeply the use of cpu_pvr
versus SPRN_PVR which is re-read in many places in the code.

Christophe

> ---
> 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;
>
>

\
 
 \ /
  Last update: 2019-03-26 07:14    [W:0.079 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site