cpuinfo_op: consolidate extern declaration
Subsystems (4)
PATCH 1/1 cpuinfo_op: consolidate extern declaration
cpuinfo_op: consolidate extern declaration
All the architectures supported by the kernel also support /proc/cpuinfo. Only a couple actually declare the seq_operations as extern. All the others will produce a sparse warning like:
warning: symbol 'cpuinfo_op' was not declared. Should it be static?
Fix all the warnings and consolidate the declaration by putting it in <linux/seq_file.h>.
---
arch/microblaze/include/asm/processor.h | 2 -- arch/sh/include/asm/processor.h | 4 ---- arch/x86/include/asm/processor.h | 2 -- fs/proc/cpuinfo.c | 1 - include/linux/seq_file.h | 6 ++++++ 5 files changed, 6 insertions(+), 9 deletions(-)
arch/microblaze/include/asm/processor.h +0 -2
@@ -19,8 +19,6 @@#include <asm/current.h> # ifndef __ASSEMBLY__ -/* from kernel/cpu/mb.c */ -extern const struct seq_operations cpuinfo_op;# define cpu_relax () barrier()# define cpu_sleep () do {} while (0)
arch/sh/include/asm/processor.h +0 -4
@@ -96,14 +96,10 @@ extern struct sh_cpuinfo cpu_data[];#define cpu_sleep () __asm__ __volatile__ ("sleep" : : : "memory")#define cpu_relax () barrier() -/* Forward decl */ -struct seq_operations ; -extern struct pt_regs fake_swapper_regs;/* arch/sh/kernel/setup.c */ const char *get_cpu_subtype (struct sh_cpuinfo *c); -extern const struct seq_operations cpuinfo_op;/* processor boot mode configuration */ #define MODE_PIN0 (1 << 0)
arch/x86/include/asm/processor.h +0 -2
@@ -149,8 +149,6 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);#define current_cpu_data boot_cpu_data#endif -extern const struct seq_operations cpuinfo_op; -static inline int hlt_works (int cpu) {#ifdef CONFIG_X86_32
fs/proc/cpuinfo.c +0 -1
@@ -3,7 +3,6 @@#include <linux/proc_fs.h> #include <linux/seq_file.h> -extern const struct seq_operations cpuinfo_op;static int cpuinfo_open (struct inode *inode,struct file *file) {return seq_open (file, &cpuinfo_op);
include/linux/seq_file.h +6 -0
@@ -33,6 +33,12 @@ struct seq_operations {int (*show) (struct seq_file *m,void *v); }; +/* +* All architectures support /proc/cpuinfo +* Define the seq_operations here to keep things clean. +*/ +extern const struct seq_operations cpuinfo_op; +#define SEQ_SKIP 1/**
Quoted 11 lines · H Hartley Sweeten
cpuinfo_op: consolidate extern declarationAll the architectures supported by the kernel also support
/proc/cpuinfo. Only a couple actually declare theseq_operationsas extern. All the others will produce a sparse warning like:warning: symbol '
cpuinfo_op' was not declared. Should it be static?Fix all the warnings and consolidate the declaration by putting it in <
linux/seq_file.h>.
Quoted 7 lines
Signed-off-by H Hartley Sweeten <[email protected]>Cc Ingo Molnar <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Michal Simek <[email protected]>Cc Paul Mundt <[email protected]>Cc H. Peter Anvin <[email protected]>
I guess we know from this list which architectures run sparse ;-)
Quoted 11 lines · H Hartley Sweeten
cpuinfo_op: consolidate extern declarationAll the architectures supported by the kernel also support
/proc/cpuinfo. Only a couple actually declare theseq_operationsas extern. All the others will produce a sparse warning like:warning: symbol '
cpuinfo_op' was not declared. Should it be static?Fix all the warnings and consolidate the declaration by putting it in <
linux/seq_file.h>.
Quoted 7 lines
Signed-off-by H Hartley Sweeten <[email protected]>Cc Ingo Molnar <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Michal Simek <[email protected]>Cc Paul Mundt <[email protected]>Cc H. Peter Anvin <[email protected]>
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian