[PATCH 3/3] LoongArch: Relocate the seq_file declaration to the correct place

From: WangYuli
Date: Sat Feb 08 2025 - 03:04:10 EST


The seq_file structure only needs to be declared in a header file
when CONFIG_SMP is enabled. Therefore, it clearly belongs in smp.h,
which, however, does not declare it. Instead, cpuinfo.h inappropriately
declares this structure, fortuitously allowing the code to function.

Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Tianyang Zhang <zhangtianyang@xxxxxxxxxxx>
Cc: Liupu Wang <wangliupu@xxxxxxxxxxx>
Cc: Bibo Mao <maobibo@xxxxxxxxxxx>
Co-developed-by: Wentao Guan <guanwentao@xxxxxxxxxxxxx>
Signed-off-by: Wentao Guan <guanwentao@xxxxxxxxxxxxx>
Signed-off-by: Yuli Wang <wangyuli@xxxxxxxxxxxxx>
---
arch/loongarch/include/asm/cpu-info.h | 2 --
arch/loongarch/include/asm/smp.h | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/loongarch/include/asm/cpu-info.h b/arch/loongarch/include/asm/cpu-info.h
index 48217f07d37e..7f5bc0ad9d50 100644
--- a/arch/loongarch/include/asm/cpu-info.h
+++ b/arch/loongarch/include/asm/cpu-info.h
@@ -76,8 +76,6 @@ extern const char *__cpu_full_name[];
#define cpu_family_string() __cpu_family[raw_smp_processor_id()]
#define cpu_full_name_string() __cpu_full_name[raw_smp_processor_id()]

-struct seq_file;
-
static inline bool cpus_are_siblings(int cpua, int cpub)
{
struct cpuinfo_loongarch *infoa = &cpu_data[cpua];
diff --git a/arch/loongarch/include/asm/smp.h b/arch/loongarch/include/asm/smp.h
index 3383c9d24e94..8555e478d42f 100644
--- a/arch/loongarch/include/asm/smp.h
+++ b/arch/loongarch/include/asm/smp.h
@@ -14,6 +14,8 @@
#include <linux/threads.h>
#include <linux/cpumask.h>

+struct seq_file;
+
struct smp_ops {
void (*init_ipi)(void);
void (*send_ipi_single)(int cpu, unsigned int action);
--
2.47.2