linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpuinfo_op: consolidate extern declaration
@ 2010-01-14 18:58 H Hartley Sweeten
  2010-01-14 23:46 ` Paul Mundt
  2010-01-15  8:06 ` Michal Simek
  0 siblings, 2 replies; 3+ messages in thread
From: H Hartley Sweeten @ 2010-01-14 18:58 UTC (permalink / raw)
  To: Linux Kernel, linux-sh, microblaze-uclinux, x86
  Cc: mingo, tglx, monstr, lethal, hpa

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>.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: H. Peter Anvin <hpa@zytor.com>

---

 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(-)

diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index 563c6b9..e2f8c73 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -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)
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 017e0c1..fb4f942 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -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)
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index fc801ba..5c17303 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -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
diff --git a/fs/proc/cpuinfo.c b/fs/proc/cpuinfo.c
index 5a1e539..f8eea8e 100644
--- a/fs/proc/cpuinfo.c
+++ b/fs/proc/cpuinfo.c
@@ -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);
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 8366d8f..ab13819 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -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
 
 /**

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpuinfo_op: consolidate extern declaration
  2010-01-14 18:58 [PATCH] cpuinfo_op: consolidate extern declaration H Hartley Sweeten
@ 2010-01-14 23:46 ` Paul Mundt
  2010-01-15  8:06 ` Michal Simek
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2010-01-14 23:46 UTC (permalink / raw)
  To: H Hartley Sweeten
  Cc: Linux Kernel, linux-sh, microblaze-uclinux, x86, mingo, tglx,
	monstr, hpa

On Thu, Jan 14, 2010 at 11:58:09AM -0700, H Hartley Sweeten wrote:
> 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>.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: H. Peter Anvin <hpa@zytor.com>
> 
I guess we know from this list which architectures run sparse ;-)

Acked-by: Paul Mundt <lethal@linux-sh.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpuinfo_op: consolidate extern declaration
  2010-01-14 18:58 [PATCH] cpuinfo_op: consolidate extern declaration H Hartley Sweeten
  2010-01-14 23:46 ` Paul Mundt
@ 2010-01-15  8:06 ` Michal Simek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2010-01-15  8:06 UTC (permalink / raw)
  To: H Hartley Sweeten
  Cc: Linux Kernel, linux-sh, microblaze-uclinux, x86, mingo, tglx,
	lethal, hpa

H Hartley Sweeten wrote:
> 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>.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: H. Peter Anvin <hpa@zytor.com>
> 

Tested-by: Michal Simek <monstr@monstr.eu>


-- 
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-15  8:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14 18:58 [PATCH] cpuinfo_op: consolidate extern declaration H Hartley Sweeten
2010-01-14 23:46 ` Paul Mundt
2010-01-15  8:06 ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).