diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-07-03 03:24:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:26:59 -0400 |
commit | 62322d2554d2f9680c8ace7bbf1f97d8fa84ad1a (patch) | |
tree | 904f8b8354a4079cc1daaa355fe30200dcae9dc9 /drivers/char/misc.c | |
parent | d459ec0baa5d22e111dfb139c46d6d788a9eac20 (diff) |
[PATCH] make more file_operation structs static
Mark the static struct file_operations in drivers/char as const. Making
them const prevents accidental bugs, and moves them to the .rodata section
so that they no longer do any false sharing; in addition with the proper
debug option they are then protected against corruption..
[akpm@osdl.org: build fix]
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/misc.c')
-rw-r--r-- | drivers/char/misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index d5fa19da330b..62ebe09656e3 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -113,7 +113,7 @@ static int misc_seq_open(struct inode *inode, struct file *file) | |||
113 | return seq_open(file, &misc_seq_ops); | 113 | return seq_open(file, &misc_seq_ops); |
114 | } | 114 | } |
115 | 115 | ||
116 | static struct file_operations misc_proc_fops = { | 116 | static const struct file_operations misc_proc_fops = { |
117 | .owner = THIS_MODULE, | 117 | .owner = THIS_MODULE, |
118 | .open = misc_seq_open, | 118 | .open = misc_seq_open, |
119 | .read = seq_read, | 119 | .read = seq_read, |
@@ -176,7 +176,7 @@ fail: | |||
176 | */ | 176 | */ |
177 | static struct class *misc_class; | 177 | static struct class *misc_class; |
178 | 178 | ||
179 | static struct file_operations misc_fops = { | 179 | static const struct file_operations misc_fops = { |
180 | .owner = THIS_MODULE, | 180 | .owner = THIS_MODULE, |
181 | .open = misc_open, | 181 | .open = misc_open, |
182 | }; | 182 | }; |