Commit 03329f13 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] mtrr warning fix w/o proc_fs

From: Stephen Hemminger <shemminger@osdl.org>

Get rid of warnings (and dead code) if MTRR is compiled without /proc
parent f9e416d3
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
/* RED-PEN: this is accessed without any locking */ /* RED-PEN: this is accessed without any locking */
extern unsigned int *usage_table; 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) #define FILE_FCOUNT(f) (((struct seq_file *)((f)->private_data))->private)
...@@ -33,6 +32,8 @@ char *mtrr_attrib_to_str(int x) ...@@ -33,6 +32,8 @@ char *mtrr_attrib_to_str(int x)
return (x <= 6) ? mtrr_strings[x] : "?"; return (x <= 6) ? mtrr_strings[x] : "?";
} }
#ifdef CONFIG_PROC_FS
static int static int
mtrr_file_add(unsigned long base, unsigned long size, mtrr_file_add(unsigned long base, unsigned long size,
unsigned int type, char increment, struct file *file, int page) unsigned int type, char increment, struct file *file, int page)
...@@ -291,6 +292,8 @@ mtrr_close(struct inode *ino, struct file *file) ...@@ -291,6 +292,8 @@ mtrr_close(struct inode *ino, struct file *file)
return single_release(ino, file); 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) static int mtrr_open(struct inode *inode, struct file *file)
{ {
if (!mtrr_if) if (!mtrr_if)
...@@ -310,11 +313,9 @@ static struct file_operations mtrr_fops = { ...@@ -310,11 +313,9 @@ static struct file_operations mtrr_fops = {
.release = mtrr_close, .release = mtrr_close,
}; };
# ifdef CONFIG_PROC_FS
static struct proc_dir_entry *proc_root_mtrr; static struct proc_dir_entry *proc_root_mtrr;
# endif /* CONFIG_PROC_FS */
static int mtrr_seq_show(struct seq_file *seq, void *offset) static int mtrr_seq_show(struct seq_file *seq, void *offset)
{ {
...@@ -351,15 +352,14 @@ static int mtrr_seq_show(struct seq_file *seq, void *offset) ...@@ -351,15 +352,14 @@ static int mtrr_seq_show(struct seq_file *seq, void *offset)
static int __init mtrr_if_init(void) static int __init mtrr_if_init(void)
{ {
#ifdef CONFIG_PROC_FS
proc_root_mtrr = proc_root_mtrr =
create_proc_entry("mtrr", S_IWUSR | S_IRUGO, &proc_root); create_proc_entry("mtrr", S_IWUSR | S_IRUGO, &proc_root);
if (proc_root_mtrr) { if (proc_root_mtrr) {
proc_root_mtrr->owner = THIS_MODULE; proc_root_mtrr->owner = THIS_MODULE;
proc_root_mtrr->proc_fops = &mtrr_fops; proc_root_mtrr->proc_fops = &mtrr_fops;
} }
#endif
return 0; return 0;
} }
arch_initcall(mtrr_if_init); arch_initcall(mtrr_if_init);
#endif /* CONFIG_PROC_FS */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment