[<prev] [next>] [day] [month] [year] [list]
Message-ID: <9EF27D49B23CCF72+20250208080221.1083810-4-wangyuli@uniontech.com>
Date: Sat, 8 Feb 2025 16:02:21 +0800
From: WangYuli <wangyuli@...ontech.com>
To: chenhuacai@...nel.org,
kernel@...0n.name,
guanwentao@...ontech.com,
jiaxun.yang@...goat.com,
wangyuli@...ontech.com
Cc: loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org,
zhanjun@...onetch.com,
chenlinxuan@...ontech.com,
Thomas Gleixner <tglx@...utronix.de>,
Tianyang Zhang <zhangtianyang@...ngson.cn>,
Liupu Wang <wangliupu@...ngson.cn>,
Bibo Mao <maobibo@...ngson.cn>
Subject: [PATCH 3/3] LoongArch: Relocate the seq_file declaration to the correct place
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@...utronix.de>
Cc: Tianyang Zhang <zhangtianyang@...ngson.cn>
Cc: Liupu Wang <wangliupu@...ngson.cn>
Cc: Bibo Mao <maobibo@...ngson.cn>
Co-developed-by: Wentao Guan <guanwentao@...ontech.com>
Signed-off-by: Wentao Guan <guanwentao@...ontech.com>
Signed-off-by: Yuli Wang <wangyuli@...ontech.com>
---
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
Powered by blists - more mailing lists