diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:45 -0500 |
commit | 2b8693c0617e972fc0b2fd1ebf8de97e15b656c3 (patch) | |
tree | 3eb7dfbc8d5e4031e4992bdd566e211f5ada71f3 /drivers/isdn/capi | |
parent | 5dfe4c964a0dd7bb3a1d64a4166835a153146207 (diff) |
[PATCH] mark struct file_operations const 3
Many struct file_operations in the kernel can be "const". Marking them const
moves these to the .rodata section, which avoids false sharing with potential
dirty data. In addition it'll catch accidental writes at compile time to
these shared resources.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn/capi')
-rw-r--r-- | drivers/isdn/capi/capi.c | 2 | ||||
-rw-r--r-- | drivers/isdn/capi/kcapi_proc.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 9e48bb5a3c09..db1260f73f10 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c | |||
@@ -1003,7 +1003,7 @@ capi_release(struct inode *inode, struct file *file) | |||
1003 | return 0; | 1003 | return 0; |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | static struct file_operations capi_fops = | 1006 | static const struct file_operations capi_fops = |
1007 | { | 1007 | { |
1008 | .owner = THIS_MODULE, | 1008 | .owner = THIS_MODULE, |
1009 | .llseek = no_llseek, | 1009 | .llseek = no_llseek, |
diff --git a/drivers/isdn/capi/kcapi_proc.c b/drivers/isdn/capi/kcapi_proc.c index ca9dc00a45c4..31f4fd8b8b0a 100644 --- a/drivers/isdn/capi/kcapi_proc.c +++ b/drivers/isdn/capi/kcapi_proc.c | |||
@@ -113,14 +113,14 @@ static int seq_contrstats_open(struct inode *inode, struct file *file) | |||
113 | return seq_open(file, &seq_contrstats_ops); | 113 | return seq_open(file, &seq_contrstats_ops); |
114 | } | 114 | } |
115 | 115 | ||
116 | static struct file_operations proc_controller_ops = { | 116 | static const struct file_operations proc_controller_ops = { |
117 | .open = seq_controller_open, | 117 | .open = seq_controller_open, |
118 | .read = seq_read, | 118 | .read = seq_read, |
119 | .llseek = seq_lseek, | 119 | .llseek = seq_lseek, |
120 | .release = seq_release, | 120 | .release = seq_release, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | static struct file_operations proc_contrstats_ops = { | 123 | static const struct file_operations proc_contrstats_ops = { |
124 | .open = seq_contrstats_open, | 124 | .open = seq_contrstats_open, |
125 | .read = seq_read, | 125 | .read = seq_read, |
126 | .llseek = seq_lseek, | 126 | .llseek = seq_lseek, |
@@ -218,14 +218,14 @@ seq_applstats_open(struct inode *inode, struct file *file) | |||
218 | return seq_open(file, &seq_applstats_ops); | 218 | return seq_open(file, &seq_applstats_ops); |
219 | } | 219 | } |
220 | 220 | ||
221 | static struct file_operations proc_applications_ops = { | 221 | static const struct file_operations proc_applications_ops = { |
222 | .open = seq_applications_open, | 222 | .open = seq_applications_open, |
223 | .read = seq_read, | 223 | .read = seq_read, |
224 | .llseek = seq_lseek, | 224 | .llseek = seq_lseek, |
225 | .release = seq_release, | 225 | .release = seq_release, |
226 | }; | 226 | }; |
227 | 227 | ||
228 | static struct file_operations proc_applstats_ops = { | 228 | static const struct file_operations proc_applstats_ops = { |
229 | .open = seq_applstats_open, | 229 | .open = seq_applstats_open, |
230 | .read = seq_read, | 230 | .read = seq_read, |
231 | .llseek = seq_lseek, | 231 | .llseek = seq_lseek, |
@@ -302,7 +302,7 @@ seq_capi_driver_open(struct inode *inode, struct file *file) | |||
302 | return err; | 302 | return err; |
303 | } | 303 | } |
304 | 304 | ||
305 | static struct file_operations proc_driver_ops = { | 305 | static const struct file_operations proc_driver_ops = { |
306 | .open = seq_capi_driver_open, | 306 | .open = seq_capi_driver_open, |
307 | .read = seq_read, | 307 | .read = seq_read, |
308 | .llseek = seq_lseek, | 308 | .llseek = seq_lseek, |