All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Linux kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] procfs : Move some extern declaration from fs/proc/proc_misc.c to include/linux/seq_file.h
Date: Tue, 18 Dec 2007 22:25:50 +0100	[thread overview]
Message-ID: <47683ADE.3080107@cosmosbay.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

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@cosmosbay.com>

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


[-- Attachment #2: seq.patch --]
[-- Type: text/plain, Size: 3360 bytes --]

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

             reply	other threads:[~2007-12-18 21:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18 21:25 Eric Dumazet [this message]
2007-12-18 22:22 ` [PATCH] procfs : Move some extern declaration from fs/proc/proc_misc.c to include/linux/seq_file.h Matt Mackall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47683ADE.3080107@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.