aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/proc.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 03:55:35 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:46 -0500
commit9a32144e9d7b4e21341174b1a83b82a82353be86 (patch)
tree6f08560b341418fc9934f56f6162a95f5b5d8aec /net/atm/proc.c
parent00977a59b951207d38380c75f03a36829950265c (diff)
[PATCH] mark struct file_operations const 7
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 'net/atm/proc.c')
-rw-r--r--net/atm/proc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 190f49ce2cad..9e61e512f667 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -33,7 +33,7 @@
33static ssize_t proc_dev_atm_read(struct file *file,char __user *buf,size_t count, 33static ssize_t proc_dev_atm_read(struct file *file,char __user *buf,size_t count,
34 loff_t *pos); 34 loff_t *pos);
35 35
36static struct file_operations proc_atm_dev_ops = { 36static const struct file_operations proc_atm_dev_ops = {
37 .owner = THIS_MODULE, 37 .owner = THIS_MODULE,
38 .read = proc_dev_atm_read, 38 .read = proc_dev_atm_read,
39}; 39};
@@ -272,7 +272,7 @@ static int atm_dev_seq_open(struct inode *inode, struct file *file)
272 return seq_open(file, &atm_dev_seq_ops); 272 return seq_open(file, &atm_dev_seq_ops);
273} 273}
274 274
275static struct file_operations devices_seq_fops = { 275static const struct file_operations devices_seq_fops = {
276 .open = atm_dev_seq_open, 276 .open = atm_dev_seq_open,
277 .read = seq_read, 277 .read = seq_read,
278 .llseek = seq_lseek, 278 .llseek = seq_lseek,
@@ -307,7 +307,7 @@ static int pvc_seq_open(struct inode *inode, struct file *file)
307 return __vcc_seq_open(inode, file, PF_ATMPVC, &pvc_seq_ops); 307 return __vcc_seq_open(inode, file, PF_ATMPVC, &pvc_seq_ops);
308} 308}
309 309
310static struct file_operations pvc_seq_fops = { 310static const struct file_operations pvc_seq_fops = {
311 .open = pvc_seq_open, 311 .open = pvc_seq_open,
312 .read = seq_read, 312 .read = seq_read,
313 .llseek = seq_lseek, 313 .llseek = seq_lseek,
@@ -341,7 +341,7 @@ static int vcc_seq_open(struct inode *inode, struct file *file)
341 return __vcc_seq_open(inode, file, 0, &vcc_seq_ops); 341 return __vcc_seq_open(inode, file, 0, &vcc_seq_ops);
342} 342}
343 343
344static struct file_operations vcc_seq_fops = { 344static const struct file_operations vcc_seq_fops = {
345 .open = vcc_seq_open, 345 .open = vcc_seq_open,
346 .read = seq_read, 346 .read = seq_read,
347 .llseek = seq_lseek, 347 .llseek = seq_lseek,
@@ -376,7 +376,7 @@ static int svc_seq_open(struct inode *inode, struct file *file)
376 return __vcc_seq_open(inode, file, PF_ATMSVC, &svc_seq_ops); 376 return __vcc_seq_open(inode, file, PF_ATMSVC, &svc_seq_ops);
377} 377}
378 378
379static struct file_operations svc_seq_fops = { 379static const struct file_operations svc_seq_fops = {
380 .open = svc_seq_open, 380 .open = svc_seq_open,
381 .read = seq_read, 381 .read = seq_read,
382 .llseek = seq_lseek, 382 .llseek = seq_lseek,
@@ -457,7 +457,7 @@ void atm_proc_dev_deregister(struct atm_dev *dev)
457 457
458static struct atm_proc_entry { 458static struct atm_proc_entry {
459 char *name; 459 char *name;
460 struct file_operations *proc_fops; 460 const struct file_operations *proc_fops;
461 struct proc_dir_entry *dirent; 461 struct proc_dir_entry *dirent;
462} atm_proc_ents[] = { 462} atm_proc_ents[] = {
463 { .name = "devices", .proc_fops = &devices_seq_fops }, 463 { .name = "devices", .proc_fops = &devices_seq_fops },