[PATCH] procfs : Move some extern declaration from fs/proc/proc_misc.cto include/linux/seq_file.h

From: Eric Dumazet
Date: Tue Dec 18 2007 - 16:26:29 EST


Some 'extern struct seq_operations' are wrongly defined in fs/proc/proc_misc.c (they miss a const qualifier)

In order to fix this correctly, move the "extern ... " declaration from .c file to an appropriate include file, as advised by checkpatch.pl

Note : "extern struct seq_operations cpuinfo_op;" will be taken into account
in a separate patch, since its const status is arch dependant.

Signed-off-by: Eric Dumazet <dada1@xxxxxxxxxxxxx>

fs/proc/proc_misc.c | 9 ---------
include/linux/seq_file.h | 11 +++++++++++
2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index e0d064e..6344881 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -216,7 +216,6 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
#undef K
}

-extern struct seq_operations fragmentation_op;
static int fragmentation_open(struct inode *inode, struct file *file)
{
(void)inode;
@@ -230,7 +229,6 @@ static const struct file_operations fragmentation_file_operations = {
.release = seq_release,
};

-extern struct seq_operations pagetypeinfo_op;
static int pagetypeinfo_open(struct inode *inode, struct file *file)
{
return seq_open(file, &pagetypeinfo_op);
@@ -243,7 +241,6 @@ static const struct file_operations pagetypeinfo_file_ops = {
.release = seq_release,
};

-extern struct seq_operations zoneinfo_op;
static int zoneinfo_open(struct inode *inode, struct file *file)
{
return seq_open(file, &zoneinfo_op);
@@ -340,7 +337,6 @@ static const struct file_operations proc_devinfo_operations = {
.release = seq_release,
};

-extern struct seq_operations vmstat_op;
static int vmstat_open(struct inode *inode, struct file *file)
{
return seq_open(file, &vmstat_op);
@@ -371,7 +367,6 @@ static int stram_read_proc(char *page, char **start, off_t off,
#endif

#ifdef CONFIG_BLOCK
-extern struct seq_operations partitions_op;
static int partitions_open(struct inode *inode, struct file *file)
{
return seq_open(file, &partitions_op);
@@ -383,7 +378,6 @@ static const struct file_operations proc_partitions_operations = {
.release = seq_release,
};

-extern struct seq_operations diskstats_op;
static int diskstats_open(struct inode *inode, struct file *file)
{
return seq_open(file, &diskstats_op);
@@ -397,7 +391,6 @@ static const struct file_operations proc_diskstats_operations = {
#endif

#ifdef CONFIG_MODULES
-extern struct seq_operations modules_op;
static int modules_open(struct inode *inode, struct file *file)
{
return seq_open(file, &modules_op);
@@ -424,7 +417,6 @@ static const struct file_operations proc_slabinfo_operations = {
};

#ifdef CONFIG_DEBUG_SLAB_LEAK
-extern struct seq_operations slabstats_op;
static int slabstats_open(struct inode *inode, struct file *file)
{
unsigned long *n = kzalloc(PAGE_SIZE, GFP_KERNEL);
@@ -598,7 +590,6 @@ static void int_seq_stop(struct seq_file *f, void *v)
}


-extern int show_interrupts(struct seq_file *f, void *v); /* In arch code */
static struct seq_operations int_seq_ops = {
.start = int_seq_start,
.next = int_seq_next,
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index ebbc02b..90a1cdd 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -63,5 +63,16 @@ extern struct list_head *seq_list_start_head(struct list_head *head,
extern struct list_head *seq_list_next(void *v, struct list_head *head,
loff_t *ppos);

+int show_interrupts(struct seq_file *f, void *v); /* In arch code */
+
+extern const struct seq_operations modules_op;
+extern const struct seq_operations slabstats_op;
+extern struct seq_operations diskstats_op;
+extern struct seq_operations partitions_op;
+extern const struct seq_operations vmstat_op;
+extern const struct seq_operations zoneinfo_op;
+extern const struct seq_operations pagetypeinfo_op;
+extern const struct seq_operations fragmentation_op;
+
#endif
#endif