Skip to content

Commit 6b72cd9

Browse files
Avenger-285714chenhuacai
authored andcommitted
LoongArch: Remove the deprecated notifier hook mechanism
The notifier hook mechanism in proc and cpuinfo is actually unnecessary for LoongArch because it's not used anywhere. It was originally added to the MIPS code in commit d6d3c9a ("MIPS: MT: proc: Add support for printing VPE and TC ids"), and LoongArch then inherited it. But as the kernel code stands now, this notifier hook mechanism doesn't really make sense for either LoongArch or MIPS. In addition, the seq_file forward declaration needs to be moved to its proper place, as only the show_ipi_list() function in smp.c requires it. Co-developed-by: Wentao Guan <[email protected]> Signed-off-by: Wentao Guan <[email protected]> Signed-off-by: Yuli Wang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 03a99d1 commit 6b72cd9

File tree

3 files changed

+2
-43
lines changed

3 files changed

+2
-43
lines changed

arch/loongarch/include/asm/cpu-info.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,6 @@ extern const char *__cpu_full_name[];
7676
#define cpu_family_string() __cpu_family[raw_smp_processor_id()]
7777
#define cpu_full_name_string() __cpu_full_name[raw_smp_processor_id()]
7878

79-
struct seq_file;
80-
struct notifier_block;
81-
82-
extern int register_proc_cpuinfo_notifier(struct notifier_block *nb);
83-
extern int proc_cpuinfo_notifier_call_chain(unsigned long val, void *v);
84-
85-
#define proc_cpuinfo_notifier(fn, pri) \
86-
({ \
87-
static struct notifier_block fn##_nb = { \
88-
.notifier_call = fn, \
89-
.priority = pri \
90-
}; \
91-
\
92-
register_proc_cpuinfo_notifier(&fn##_nb); \
93-
})
94-
95-
struct proc_cpuinfo_notifier_args {
96-
struct seq_file *m;
97-
unsigned long n;
98-
};
99-
10079
static inline bool cpus_are_siblings(int cpua, int cpub)
10180
{
10281
struct cpuinfo_loongarch *infoa = &cpu_data[cpua];

arch/loongarch/include/asm/smp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ extern int __cpu_logical_map[NR_CPUS];
7777
#define SMP_IRQ_WORK BIT(ACTION_IRQ_WORK)
7878
#define SMP_CLEAR_VECTOR BIT(ACTION_CLEAR_VECTOR)
7979

80+
struct seq_file;
81+
8082
struct secondary_data {
8183
unsigned long stack;
8284
unsigned long thread_info;

arch/loongarch/kernel/proc.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,12 @@
1313
#include <asm/processor.h>
1414
#include <asm/time.h>
1515

16-
/*
17-
* No lock; only written during early bootup by CPU 0.
18-
*/
19-
static RAW_NOTIFIER_HEAD(proc_cpuinfo_chain);
20-
21-
int __ref register_proc_cpuinfo_notifier(struct notifier_block *nb)
22-
{
23-
return raw_notifier_chain_register(&proc_cpuinfo_chain, nb);
24-
}
25-
26-
int proc_cpuinfo_notifier_call_chain(unsigned long val, void *v)
27-
{
28-
return raw_notifier_call_chain(&proc_cpuinfo_chain, val, v);
29-
}
30-
3116
static int show_cpuinfo(struct seq_file *m, void *v)
3217
{
3318
unsigned long n = (unsigned long) v - 1;
3419
unsigned int isa = cpu_data[n].isa_level;
3520
unsigned int version = cpu_data[n].processor_id & 0xff;
3621
unsigned int fp_version = cpu_data[n].fpu_vers;
37-
struct proc_cpuinfo_notifier_args proc_cpuinfo_notifier_args;
3822

3923
#ifdef CONFIG_SMP
4024
if (!cpu_online(n))
@@ -97,12 +81,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
9781
cpu_data[n].watch_ireg_count, cpu_data[n].watch_dreg_count);
9882
}
9983

100-
proc_cpuinfo_notifier_args.m = m;
101-
proc_cpuinfo_notifier_args.n = n;
102-
103-
raw_notifier_call_chain(&proc_cpuinfo_chain, 0,
104-
&proc_cpuinfo_notifier_args);
105-
10684
seq_printf(m, "\n\n");
10785

10886
return 0;

0 commit comments

Comments
 (0)