Re: [PATCH 1/6] asm-generic: add a cpuinfo_ops definition in shared code

From: Conor.Dooley
Date: Sun Aug 21 2022 - 07:44:53 EST


On 21/08/2022 12:35, Conor Dooley wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> asm-generic: add a cpuinfo_ops definition in shared code

Meh, bad subject..
Obviously not going to respin right away for that.

>
> From: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
>
> On RISC-V sparse complains that:
> arch/riscv/kernel/cpu.c:204:29: warning: symbol 'cpuinfo_op' was not declared. Should it be static?
>
> Sure, it could be dumped into asm/processor.h like other archs have
> done, but putting it in an asm-generic header seems to be a saner
> strategy.
>
> Fixes: 76d2a0493a17 ("RISC-V: Init and Halt Code")
> Signed-off-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
> ---
> arch/riscv/include/asm/processor.h | 1 +
> include/asm-generic/processor.h | 7 +++++++
> 2 files changed, 8 insertions(+)
> create mode 100644 include/asm-generic/processor.h
>
> diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h
> index 19eedd4af4cd..dd2c9a382192 100644
> --- a/arch/riscv/include/asm/processor.h
> +++ b/arch/riscv/include/asm/processor.h
> @@ -9,6 +9,7 @@
> #include <linux/const.h>
>
> #include <vdso/processor.h>
> +#include <asm-generic/processor.h>
>
> #include <asm/ptrace.h>
>
> diff --git a/include/asm-generic/processor.h b/include/asm-generic/processor.h
> new file mode 100644
> index 000000000000..2ec9af562e9b
> --- /dev/null
> +++ b/include/asm-generic/processor.h
> @@ -0,0 +1,7 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef __ASM_PROCESSOR_H
> +#define __ASM_PROCESSOR_H
> +
> +extern const struct seq_operations cpuinfo_op;
> +
> +#endif /* __ASM_PROCESSOR_H */
> --
> 2.37.1
>