Skip to contentSkip to conversation

cpuinfo_op: consolidate extern declaration

PATCH In review H Hartley Sweeten 2 participants 2 messages Jun 8, 2011 – Jun 10, 2011

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 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>.

Cc "David S. Miller" <[email protected]>
Cc Chris Metcalf <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Magnus Damm <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Hans Rosenfeld <[email protected]>
Cc Len Brown <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Tejun Heo <[email protected]>

---

v3: bah... fix typo
v2: updated to latest linux-next and added sign offs original patch was posted Jan 14, 2010

arch/microblaze/include/asm/processor.h +0 -2
index aed2a6b..9ded678 100644
@@ -18,8 +18,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 -1
index 9c7bdfc..ba300ee 100644
@@ -127,7 +127,6 @@ extern unsigned int mem_init_done;
 
 /* arch/sh/kernel/setup.c */
 const char *get_cpu_subtype(struct sh_cpuinfo *c);
-extern const struct seq_operations cpuinfo_op;
 
 /* thread_struct flags */
 #define SH_THREAD_UAC_NOPRINT	(1 << 0)
arch/sparc/include/asm/cpudata_64.h +0 -2
index 050ef35..ac3996b 100644
@@ -35,8 +35,6 @@ DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
 #define cpu_data(__cpu)		per_cpu(__cpu_data, (__cpu))
 #define local_cpu_data()	__get_cpu_var(__cpu_data)
 
-extern const struct seq_operations cpuinfo_op;
-
 #endif /* !(__ASSEMBLY__) */
 
 #include <asm/trap_block.h>
arch/tile/include/asm/processor.h +0 -4
index 34c1e01..d95fcc7 100644
@@ -257,10 +257,6 @@ static inline void cpu_relax(void)
 	barrier();
 }
 
-/* Info on this processor (see fs/proc/cpuinfo.c) */
-struct seq_operations;
-extern const struct seq_operations cpuinfo_op;
-
 /* Provide information about the chip model. */
 extern char chip_model[64];
 
arch/x86/include/asm/processor.h +0 -2
index 2193715..98eb12d 100644
@@ -142,8 +142,6 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
 #define cpu_data(cpu)		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
index 5a1e539..f8eea8e 100644
@@ -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
index 03c0232..46e90eb 100644
@@ -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
 
 /**
Acked-by on v3 1/1
#1 lore raw

arch/tile/include/asm/processor.h

Quoted 12 lines · H Hartley Sweeten

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/tile/include/asm/processor.h +0 -0
Signature · 2 lines
Chris Metcalf, Tilera Corp.
http://www.tilera.com