diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:44 -0500 |
commit | 5dfe4c964a0dd7bb3a1d64a4166835a153146207 (patch) | |
tree | 2fb2fd8c09922be4f40a5a9ac50b537b1d780e27 /arch/powerpc/platforms | |
parent | 540473208f8ac71c25a87e1a2670c3c18dd4d6db (diff) |
[PATCH] mark struct file_operations const 2
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.
[akpm@osdl.org: sparc64 fix]
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 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/file.c | 40 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/lpevents.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/mf.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/proc.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/viopath.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/hvCall_inst.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/reconfig.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/rtasd.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/scanlog.c | 2 |
11 files changed, 31 insertions, 31 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 347eff56fcbd..af9e9455a706 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -144,7 +144,7 @@ spufs_mem_mmap(struct file *file, struct vm_area_struct *vma) | |||
144 | return 0; | 144 | return 0; |
145 | } | 145 | } |
146 | 146 | ||
147 | static struct file_operations spufs_mem_fops = { | 147 | static const struct file_operations spufs_mem_fops = { |
148 | .open = spufs_mem_open, | 148 | .open = spufs_mem_open, |
149 | .read = spufs_mem_read, | 149 | .read = spufs_mem_read, |
150 | .write = spufs_mem_write, | 150 | .write = spufs_mem_write, |
@@ -249,7 +249,7 @@ static int spufs_cntl_open(struct inode *inode, struct file *file) | |||
249 | spufs_cntl_set, "0x%08lx"); | 249 | spufs_cntl_set, "0x%08lx"); |
250 | } | 250 | } |
251 | 251 | ||
252 | static struct file_operations spufs_cntl_fops = { | 252 | static const struct file_operations spufs_cntl_fops = { |
253 | .open = spufs_cntl_open, | 253 | .open = spufs_cntl_open, |
254 | .release = simple_attr_close, | 254 | .release = simple_attr_close, |
255 | .read = simple_attr_read, | 255 | .read = simple_attr_read, |
@@ -309,7 +309,7 @@ spufs_regs_write(struct file *file, const char __user *buffer, | |||
309 | return ret; | 309 | return ret; |
310 | } | 310 | } |
311 | 311 | ||
312 | static struct file_operations spufs_regs_fops = { | 312 | static const struct file_operations spufs_regs_fops = { |
313 | .open = spufs_regs_open, | 313 | .open = spufs_regs_open, |
314 | .read = spufs_regs_read, | 314 | .read = spufs_regs_read, |
315 | .write = spufs_regs_write, | 315 | .write = spufs_regs_write, |
@@ -360,7 +360,7 @@ spufs_fpcr_write(struct file *file, const char __user * buffer, | |||
360 | return ret; | 360 | return ret; |
361 | } | 361 | } |
362 | 362 | ||
363 | static struct file_operations spufs_fpcr_fops = { | 363 | static const struct file_operations spufs_fpcr_fops = { |
364 | .open = spufs_regs_open, | 364 | .open = spufs_regs_open, |
365 | .read = spufs_fpcr_read, | 365 | .read = spufs_fpcr_read, |
366 | .write = spufs_fpcr_write, | 366 | .write = spufs_fpcr_write, |
@@ -426,7 +426,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf, | |||
426 | return count; | 426 | return count; |
427 | } | 427 | } |
428 | 428 | ||
429 | static struct file_operations spufs_mbox_fops = { | 429 | static const struct file_operations spufs_mbox_fops = { |
430 | .open = spufs_pipe_open, | 430 | .open = spufs_pipe_open, |
431 | .read = spufs_mbox_read, | 431 | .read = spufs_mbox_read, |
432 | }; | 432 | }; |
@@ -452,7 +452,7 @@ static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf, | |||
452 | return 4; | 452 | return 4; |
453 | } | 453 | } |
454 | 454 | ||
455 | static struct file_operations spufs_mbox_stat_fops = { | 455 | static const struct file_operations spufs_mbox_stat_fops = { |
456 | .open = spufs_pipe_open, | 456 | .open = spufs_pipe_open, |
457 | .read = spufs_mbox_stat_read, | 457 | .read = spufs_mbox_stat_read, |
458 | }; | 458 | }; |
@@ -559,7 +559,7 @@ static unsigned int spufs_ibox_poll(struct file *file, poll_table *wait) | |||
559 | return mask; | 559 | return mask; |
560 | } | 560 | } |
561 | 561 | ||
562 | static struct file_operations spufs_ibox_fops = { | 562 | static const struct file_operations spufs_ibox_fops = { |
563 | .open = spufs_pipe_open, | 563 | .open = spufs_pipe_open, |
564 | .read = spufs_ibox_read, | 564 | .read = spufs_ibox_read, |
565 | .poll = spufs_ibox_poll, | 565 | .poll = spufs_ibox_poll, |
@@ -585,7 +585,7 @@ static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf, | |||
585 | return 4; | 585 | return 4; |
586 | } | 586 | } |
587 | 587 | ||
588 | static struct file_operations spufs_ibox_stat_fops = { | 588 | static const struct file_operations spufs_ibox_stat_fops = { |
589 | .open = spufs_pipe_open, | 589 | .open = spufs_pipe_open, |
590 | .read = spufs_ibox_stat_read, | 590 | .read = spufs_ibox_stat_read, |
591 | }; | 591 | }; |
@@ -692,7 +692,7 @@ static unsigned int spufs_wbox_poll(struct file *file, poll_table *wait) | |||
692 | return mask; | 692 | return mask; |
693 | } | 693 | } |
694 | 694 | ||
695 | static struct file_operations spufs_wbox_fops = { | 695 | static const struct file_operations spufs_wbox_fops = { |
696 | .open = spufs_pipe_open, | 696 | .open = spufs_pipe_open, |
697 | .write = spufs_wbox_write, | 697 | .write = spufs_wbox_write, |
698 | .poll = spufs_wbox_poll, | 698 | .poll = spufs_wbox_poll, |
@@ -718,7 +718,7 @@ static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf, | |||
718 | return 4; | 718 | return 4; |
719 | } | 719 | } |
720 | 720 | ||
721 | static struct file_operations spufs_wbox_stat_fops = { | 721 | static const struct file_operations spufs_wbox_stat_fops = { |
722 | .open = spufs_pipe_open, | 722 | .open = spufs_pipe_open, |
723 | .read = spufs_wbox_stat_read, | 723 | .read = spufs_wbox_stat_read, |
724 | }; | 724 | }; |
@@ -823,7 +823,7 @@ static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma) | |||
823 | return 0; | 823 | return 0; |
824 | } | 824 | } |
825 | 825 | ||
826 | static struct file_operations spufs_signal1_fops = { | 826 | static const struct file_operations spufs_signal1_fops = { |
827 | .open = spufs_signal1_open, | 827 | .open = spufs_signal1_open, |
828 | .read = spufs_signal1_read, | 828 | .read = spufs_signal1_read, |
829 | .write = spufs_signal1_write, | 829 | .write = spufs_signal1_write, |
@@ -934,7 +934,7 @@ static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma) | |||
934 | #define spufs_signal2_mmap NULL | 934 | #define spufs_signal2_mmap NULL |
935 | #endif /* !SPUFS_MMAP_4K */ | 935 | #endif /* !SPUFS_MMAP_4K */ |
936 | 936 | ||
937 | static struct file_operations spufs_signal2_fops = { | 937 | static const struct file_operations spufs_signal2_fops = { |
938 | .open = spufs_signal2_open, | 938 | .open = spufs_signal2_open, |
939 | .read = spufs_signal2_read, | 939 | .read = spufs_signal2_read, |
940 | .write = spufs_signal2_write, | 940 | .write = spufs_signal2_write, |
@@ -1037,7 +1037,7 @@ static int spufs_mss_open(struct inode *inode, struct file *file) | |||
1037 | return nonseekable_open(inode, file); | 1037 | return nonseekable_open(inode, file); |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | static struct file_operations spufs_mss_fops = { | 1040 | static const struct file_operations spufs_mss_fops = { |
1041 | .open = spufs_mss_open, | 1041 | .open = spufs_mss_open, |
1042 | .mmap = spufs_mss_mmap, | 1042 | .mmap = spufs_mss_mmap, |
1043 | }; | 1043 | }; |
@@ -1076,7 +1076,7 @@ static int spufs_psmap_open(struct inode *inode, struct file *file) | |||
1076 | return nonseekable_open(inode, file); | 1076 | return nonseekable_open(inode, file); |
1077 | } | 1077 | } |
1078 | 1078 | ||
1079 | static struct file_operations spufs_psmap_fops = { | 1079 | static const struct file_operations spufs_psmap_fops = { |
1080 | .open = spufs_psmap_open, | 1080 | .open = spufs_psmap_open, |
1081 | .mmap = spufs_psmap_mmap, | 1081 | .mmap = spufs_psmap_mmap, |
1082 | }; | 1082 | }; |
@@ -1393,7 +1393,7 @@ static int spufs_mfc_fasync(int fd, struct file *file, int on) | |||
1393 | return fasync_helper(fd, file, on, &ctx->mfc_fasync); | 1393 | return fasync_helper(fd, file, on, &ctx->mfc_fasync); |
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | static struct file_operations spufs_mfc_fops = { | 1396 | static const struct file_operations spufs_mfc_fops = { |
1397 | .open = spufs_mfc_open, | 1397 | .open = spufs_mfc_open, |
1398 | .read = spufs_mfc_read, | 1398 | .read = spufs_mfc_read, |
1399 | .write = spufs_mfc_write, | 1399 | .write = spufs_mfc_write, |
@@ -1650,7 +1650,7 @@ static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf, | |||
1650 | return ret; | 1650 | return ret; |
1651 | } | 1651 | } |
1652 | 1652 | ||
1653 | static struct file_operations spufs_mbox_info_fops = { | 1653 | static const struct file_operations spufs_mbox_info_fops = { |
1654 | .open = spufs_info_open, | 1654 | .open = spufs_info_open, |
1655 | .read = spufs_mbox_info_read, | 1655 | .read = spufs_mbox_info_read, |
1656 | .llseek = generic_file_llseek, | 1656 | .llseek = generic_file_llseek, |
@@ -1688,7 +1688,7 @@ static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf, | |||
1688 | return ret; | 1688 | return ret; |
1689 | } | 1689 | } |
1690 | 1690 | ||
1691 | static struct file_operations spufs_ibox_info_fops = { | 1691 | static const struct file_operations spufs_ibox_info_fops = { |
1692 | .open = spufs_info_open, | 1692 | .open = spufs_info_open, |
1693 | .read = spufs_ibox_info_read, | 1693 | .read = spufs_ibox_info_read, |
1694 | .llseek = generic_file_llseek, | 1694 | .llseek = generic_file_llseek, |
@@ -1729,7 +1729,7 @@ static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf, | |||
1729 | return ret; | 1729 | return ret; |
1730 | } | 1730 | } |
1731 | 1731 | ||
1732 | static struct file_operations spufs_wbox_info_fops = { | 1732 | static const struct file_operations spufs_wbox_info_fops = { |
1733 | .open = spufs_info_open, | 1733 | .open = spufs_info_open, |
1734 | .read = spufs_wbox_info_read, | 1734 | .read = spufs_wbox_info_read, |
1735 | .llseek = generic_file_llseek, | 1735 | .llseek = generic_file_llseek, |
@@ -1779,7 +1779,7 @@ static ssize_t spufs_dma_info_read(struct file *file, char __user *buf, | |||
1779 | return ret; | 1779 | return ret; |
1780 | } | 1780 | } |
1781 | 1781 | ||
1782 | static struct file_operations spufs_dma_info_fops = { | 1782 | static const struct file_operations spufs_dma_info_fops = { |
1783 | .open = spufs_info_open, | 1783 | .open = spufs_info_open, |
1784 | .read = spufs_dma_info_read, | 1784 | .read = spufs_dma_info_read, |
1785 | }; | 1785 | }; |
@@ -1830,7 +1830,7 @@ static ssize_t spufs_proxydma_info_read(struct file *file, char __user *buf, | |||
1830 | return ret; | 1830 | return ret; |
1831 | } | 1831 | } |
1832 | 1832 | ||
1833 | static struct file_operations spufs_proxydma_info_fops = { | 1833 | static const struct file_operations spufs_proxydma_info_fops = { |
1834 | .open = spufs_info_open, | 1834 | .open = spufs_info_open, |
1835 | .read = spufs_proxydma_info_read, | 1835 | .read = spufs_proxydma_info_read, |
1836 | }; | 1836 | }; |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 738b9244382f..bffc934ceadb 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -224,7 +224,7 @@ struct inode_operations spufs_dir_inode_operations = { | |||
224 | .lookup = simple_lookup, | 224 | .lookup = simple_lookup, |
225 | }; | 225 | }; |
226 | 226 | ||
227 | struct file_operations spufs_context_fops = { | 227 | const struct file_operations spufs_context_fops = { |
228 | .open = dcache_dir_open, | 228 | .open = dcache_dir_open, |
229 | .release = spufs_dir_close, | 229 | .release = spufs_dir_close, |
230 | .llseek = dcache_dir_lseek, | 230 | .llseek = dcache_dir_lseek, |
@@ -372,7 +372,7 @@ static int spufs_gang_close(struct inode *inode, struct file *file) | |||
372 | return dcache_dir_close(inode, file); | 372 | return dcache_dir_close(inode, file); |
373 | } | 373 | } |
374 | 374 | ||
375 | struct file_operations spufs_gang_fops = { | 375 | const struct file_operations spufs_gang_fops = { |
376 | .open = dcache_dir_open, | 376 | .open = dcache_dir_open, |
377 | .release = spufs_gang_close, | 377 | .release = spufs_gang_close, |
378 | .llseek = dcache_dir_lseek, | 378 | .llseek = dcache_dir_lseek, |
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c index c1f4502a3c6a..91df52a1899a 100644 --- a/arch/powerpc/platforms/iseries/lpevents.c +++ b/arch/powerpc/platforms/iseries/lpevents.c | |||
@@ -308,7 +308,7 @@ static int proc_lpevents_open(struct inode *inode, struct file *file) | |||
308 | return single_open(file, proc_lpevents_show, NULL); | 308 | return single_open(file, proc_lpevents_show, NULL); |
309 | } | 309 | } |
310 | 310 | ||
311 | static struct file_operations proc_lpevents_operations = { | 311 | static const struct file_operations proc_lpevents_operations = { |
312 | .open = proc_lpevents_open, | 312 | .open = proc_lpevents_open, |
313 | .read = seq_read, | 313 | .read = seq_read, |
314 | .llseek = seq_lseek, | 314 | .llseek = seq_lseek, |
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index 90d3d49f713e..b1187d95e3b2 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c | |||
@@ -1224,7 +1224,7 @@ out: | |||
1224 | return rc; | 1224 | return rc; |
1225 | } | 1225 | } |
1226 | 1226 | ||
1227 | static struct file_operations proc_vmlinux_operations = { | 1227 | static const struct file_operations proc_vmlinux_operations = { |
1228 | .write = proc_mf_change_vmlinux, | 1228 | .write = proc_mf_change_vmlinux, |
1229 | }; | 1229 | }; |
1230 | 1230 | ||
diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c index b54e37101e69..f2cde4180204 100644 --- a/arch/powerpc/platforms/iseries/proc.c +++ b/arch/powerpc/platforms/iseries/proc.c | |||
@@ -101,7 +101,7 @@ static int proc_titantod_open(struct inode *inode, struct file *file) | |||
101 | return single_open(file, proc_titantod_show, NULL); | 101 | return single_open(file, proc_titantod_show, NULL); |
102 | } | 102 | } |
103 | 103 | ||
104 | static struct file_operations proc_titantod_operations = { | 104 | static const struct file_operations proc_titantod_operations = { |
105 | .open = proc_titantod_open, | 105 | .open = proc_titantod_open, |
106 | .read = seq_read, | 106 | .read = seq_read, |
107 | .llseek = seq_lseek, | 107 | .llseek = seq_lseek, |
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c index a6799ed34a66..e2100ece9c65 100644 --- a/arch/powerpc/platforms/iseries/viopath.c +++ b/arch/powerpc/platforms/iseries/viopath.c | |||
@@ -173,7 +173,7 @@ static int proc_viopath_open(struct inode *inode, struct file *file) | |||
173 | return single_open(file, proc_viopath_show, NULL); | 173 | return single_open(file, proc_viopath_show, NULL); |
174 | } | 174 | } |
175 | 175 | ||
176 | static struct file_operations proc_viopath_operations = { | 176 | static const struct file_operations proc_viopath_operations = { |
177 | .open = proc_viopath_open, | 177 | .open = proc_viopath_open, |
178 | .read = seq_read, | 178 | .read = seq_read, |
179 | .llseek = seq_lseek, | 179 | .llseek = seq_lseek, |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 9437f48cc9e7..6cedbc002e0f 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -1078,7 +1078,7 @@ static int proc_eeh_open(struct inode *inode, struct file *file) | |||
1078 | return single_open(file, proc_eeh_show, NULL); | 1078 | return single_open(file, proc_eeh_show, NULL); |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | static struct file_operations proc_eeh_operations = { | 1081 | static const struct file_operations proc_eeh_operations = { |
1082 | .open = proc_eeh_open, | 1082 | .open = proc_eeh_open, |
1083 | .read = seq_read, | 1083 | .read = seq_read, |
1084 | .llseek = seq_lseek, | 1084 | .llseek = seq_lseek, |
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index 3ddc04925d50..eae51ef9af24 100644 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c | |||
@@ -90,7 +90,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file) | |||
90 | return rc; | 90 | return rc; |
91 | } | 91 | } |
92 | 92 | ||
93 | static struct file_operations hcall_inst_seq_fops = { | 93 | static const struct file_operations hcall_inst_seq_fops = { |
94 | .open = hcall_inst_seq_open, | 94 | .open = hcall_inst_seq_open, |
95 | .read = seq_read, | 95 | .read = seq_read, |
96 | .llseek = seq_lseek, | 96 | .llseek = seq_lseek, |
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 789a5e99aefd..5aa97aff3391 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -499,7 +499,7 @@ out: | |||
499 | return rv ? rv : count; | 499 | return rv ? rv : count; |
500 | } | 500 | } |
501 | 501 | ||
502 | static struct file_operations ofdt_fops = { | 502 | static const struct file_operations ofdt_fops = { |
503 | .write = ofdt_write | 503 | .write = ofdt_write |
504 | }; | 504 | }; |
505 | 505 | ||
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c index 8ca2612221d6..77d0937d5c07 100644 --- a/arch/powerpc/platforms/pseries/rtasd.c +++ b/arch/powerpc/platforms/pseries/rtasd.c | |||
@@ -331,7 +331,7 @@ static unsigned int rtas_log_poll(struct file *file, poll_table * wait) | |||
331 | return 0; | 331 | return 0; |
332 | } | 332 | } |
333 | 333 | ||
334 | struct file_operations proc_rtas_log_operations = { | 334 | const struct file_operations proc_rtas_log_operations = { |
335 | .read = rtas_log_read, | 335 | .read = rtas_log_read, |
336 | .poll = rtas_log_poll, | 336 | .poll = rtas_log_poll, |
337 | .open = rtas_log_open, | 337 | .open = rtas_log_open, |
diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c index 45368a57d7dd..8e1ef168e2dd 100644 --- a/arch/powerpc/platforms/pseries/scanlog.c +++ b/arch/powerpc/platforms/pseries/scanlog.c | |||
@@ -184,7 +184,7 @@ static int scanlog_release(struct inode * inode, struct file * file) | |||
184 | return 0; | 184 | return 0; |
185 | } | 185 | } |
186 | 186 | ||
187 | struct file_operations scanlog_fops = { | 187 | const struct file_operations scanlog_fops = { |
188 | .owner = THIS_MODULE, | 188 | .owner = THIS_MODULE, |
189 | .read = scanlog_read, | 189 | .read = scanlog_read, |
190 | .write = scanlog_write, | 190 | .write = scanlog_write, |