diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:46 -0500 |
commit | 9a32144e9d7b4e21341174b1a83b82a82353be86 (patch) | |
tree | 6f08560b341418fc9934f56f6162a95f5b5d8aec /net/atm | |
parent | 00977a59b951207d38380c75f03a36829950265c (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')
-rw-r--r-- | net/atm/br2684.c | 2 | ||||
-rw-r--r-- | net/atm/clip.c | 2 | ||||
-rw-r--r-- | net/atm/lec.c | 2 | ||||
-rw-r--r-- | net/atm/mpoa_proc.c | 2 | ||||
-rw-r--r-- | net/atm/proc.c | 12 |
5 files changed, 10 insertions, 10 deletions
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index f949b5c74ec1..ec4ebd3299e3 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
@@ -784,7 +784,7 @@ static int br2684_proc_open(struct inode *inode, struct file *file) | |||
784 | return seq_open(file, &br2684_seq_ops); | 784 | return seq_open(file, &br2684_seq_ops); |
785 | } | 785 | } |
786 | 786 | ||
787 | static struct file_operations br2684_proc_ops = { | 787 | static const struct file_operations br2684_proc_ops = { |
788 | .owner = THIS_MODULE, | 788 | .owner = THIS_MODULE, |
789 | .open = br2684_proc_open, | 789 | .open = br2684_proc_open, |
790 | .read = seq_read, | 790 | .read = seq_read, |
diff --git a/net/atm/clip.c b/net/atm/clip.c index 5f8a1d222720..ebb5d0ce8b6f 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -971,7 +971,7 @@ out_kfree: | |||
971 | goto out; | 971 | goto out; |
972 | } | 972 | } |
973 | 973 | ||
974 | static struct file_operations arp_seq_fops = { | 974 | static const struct file_operations arp_seq_fops = { |
975 | .open = arp_seq_open, | 975 | .open = arp_seq_open, |
976 | .read = seq_read, | 976 | .read = seq_read, |
977 | .llseek = seq_lseek, | 977 | .llseek = seq_lseek, |
diff --git a/net/atm/lec.c b/net/atm/lec.c index 57dc2ab1b65d..986945527691 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -1212,7 +1212,7 @@ static int lec_seq_release(struct inode *inode, struct file *file) | |||
1212 | return seq_release_private(inode, file); | 1212 | return seq_release_private(inode, file); |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | static struct file_operations lec_seq_fops = { | 1215 | static const struct file_operations lec_seq_fops = { |
1216 | .owner = THIS_MODULE, | 1216 | .owner = THIS_MODULE, |
1217 | .open = lec_seq_open, | 1217 | .open = lec_seq_open, |
1218 | .read = seq_read, | 1218 | .read = seq_read, |
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c index 43315af10309..4b05cbec7a58 100644 --- a/net/atm/mpoa_proc.c +++ b/net/atm/mpoa_proc.c | |||
@@ -39,7 +39,7 @@ static int parse_qos(const char *buff); | |||
39 | /* | 39 | /* |
40 | * Define allowed FILE OPERATIONS | 40 | * Define allowed FILE OPERATIONS |
41 | */ | 41 | */ |
42 | static struct file_operations mpc_file_operations = { | 42 | static const struct file_operations mpc_file_operations = { |
43 | .owner = THIS_MODULE, | 43 | .owner = THIS_MODULE, |
44 | .open = proc_mpc_open, | 44 | .open = proc_mpc_open, |
45 | .read = seq_read, | 45 | .read = seq_read, |
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 @@ | |||
33 | static ssize_t proc_dev_atm_read(struct file *file,char __user *buf,size_t count, | 33 | static 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 | ||
36 | static struct file_operations proc_atm_dev_ops = { | 36 | static 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 | ||
275 | static struct file_operations devices_seq_fops = { | 275 | static 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 | ||
310 | static struct file_operations pvc_seq_fops = { | 310 | static 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 | ||
344 | static struct file_operations vcc_seq_fops = { | 344 | static 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 | ||
379 | static struct file_operations svc_seq_fops = { | 379 | static 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 | ||
458 | static struct atm_proc_entry { | 458 | static 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 }, |