mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mtrr w/o proc_fs
@ 2003-09-12 18:06 Stephen Hemminger
  0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2003-09-12 18:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

Get rid of warnings (and dead code) if MTRR is compiled without /proc

diff -Nru a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c
--- a/arch/i386/kernel/cpu/mtrr/if.c	Fri Sep 12 10:57:50 2003
+++ b/arch/i386/kernel/cpu/mtrr/if.c	Fri Sep 12 10:57:50 2003
@@ -13,7 +13,6 @@
 /* RED-PEN: this is accessed without any locking */
 extern unsigned int *usage_table;
 
-static int mtrr_seq_show(struct seq_file *seq, void *offset);
 
 #define FILE_FCOUNT(f) (((struct seq_file *)((f)->private_data))->private)
 
@@ -33,6 +32,8 @@
 	return (x <= 6) ? mtrr_strings[x] : "?";
 }
 
+#ifdef CONFIG_PROC_FS
+
 static int
 mtrr_file_add(unsigned long base, unsigned long size,
 	      unsigned int type, char increment, struct file *file, int page)
@@ -291,6 +292,8 @@
 	return single_release(ino, file);
 }
 
+static int mtrr_seq_show(struct seq_file *seq, void *offset);
+
 static int mtrr_open(struct inode *inode, struct file *file)
 {
 	if (!mtrr_if) 
@@ -310,11 +313,9 @@
 	.release = mtrr_close,
 };
 
-#  ifdef CONFIG_PROC_FS
 
 static struct proc_dir_entry *proc_root_mtrr;
 
-#  endif			/*  CONFIG_PROC_FS  */
 
 static int mtrr_seq_show(struct seq_file *seq, void *offset)
 {
@@ -351,15 +352,14 @@
 
 static int __init mtrr_if_init(void)
 {
-#ifdef CONFIG_PROC_FS
 	proc_root_mtrr =
 	    create_proc_entry("mtrr", S_IWUSR | S_IRUGO, &proc_root);
 	if (proc_root_mtrr) {
 		proc_root_mtrr->owner = THIS_MODULE;
 		proc_root_mtrr->proc_fops = &mtrr_fops;
 	}
-#endif
 	return 0;
 }
 
 arch_initcall(mtrr_if_init);
+#endif			/*  CONFIG_PROC_FS  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-12 18:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-12 18:06 [PATCH] mtrr w/o proc_fs Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®