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 | |
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')
59 files changed, 94 insertions, 94 deletions
diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c index 4e5445cfb0e..bf1075e1f57 100644 --- a/arch/arm/common/rtctime.c +++ b/arch/arm/common/rtctime.c | |||
@@ -329,7 +329,7 @@ static int rtc_fasync(int fd, struct file *file, int on) | |||
329 | return fasync_helper(fd, file, on, &rtc_async_queue); | 329 | return fasync_helper(fd, file, on, &rtc_async_queue); |
330 | } | 330 | } |
331 | 331 | ||
332 | static struct file_operations rtc_fops = { | 332 | static const struct file_operations rtc_fops = { |
333 | .owner = THIS_MODULE, | 333 | .owner = THIS_MODULE, |
334 | .llseek = no_llseek, | 334 | .llseek = no_llseek, |
335 | .read = rtc_read, | 335 | .read = rtc_read, |
diff --git a/arch/arm/mach-at91rm9200/clock.c b/arch/arm/mach-at91rm9200/clock.c index 4dee21fefe5..36a8e4d1cc6 100644 --- a/arch/arm/mach-at91rm9200/clock.c +++ b/arch/arm/mach-at91rm9200/clock.c | |||
@@ -407,7 +407,7 @@ static int at91_clk_open(struct inode *inode, struct file *file) | |||
407 | return single_open(file, at91_clk_show, NULL); | 407 | return single_open(file, at91_clk_show, NULL); |
408 | } | 408 | } |
409 | 409 | ||
410 | static struct file_operations at91_clk_operations = { | 410 | static const struct file_operations at91_clk_operations = { |
411 | .open = at91_clk_open, | 411 | .open = at91_clk_open, |
412 | .read = seq_read, | 412 | .read = seq_read, |
413 | .llseek = seq_lseek, | 413 | .llseek = seq_lseek, |
diff --git a/arch/avr32/mm/tlb.c b/arch/avr32/mm/tlb.c index 7b073052203..56672018e42 100644 --- a/arch/avr32/mm/tlb.c +++ b/arch/avr32/mm/tlb.c | |||
@@ -360,7 +360,7 @@ static int tlb_open(struct inode *inode, struct file *file) | |||
360 | return seq_open(file, &tlb_ops); | 360 | return seq_open(file, &tlb_ops); |
361 | } | 361 | } |
362 | 362 | ||
363 | static struct file_operations proc_tlb_operations = { | 363 | static const struct file_operations proc_tlb_operations = { |
364 | .open = tlb_open, | 364 | .open = tlb_open, |
365 | .read = seq_read, | 365 | .read = seq_read, |
366 | .llseek = seq_lseek, | 366 | .llseek = seq_lseek, |
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c index 3cf4f23de1d..88eff7f54ea 100644 --- a/arch/cris/arch-v10/drivers/ds1302.c +++ b/arch/cris/arch-v10/drivers/ds1302.c | |||
@@ -499,7 +499,7 @@ print_rtc_status(void) | |||
499 | 499 | ||
500 | /* The various file operations we support. */ | 500 | /* The various file operations we support. */ |
501 | 501 | ||
502 | static struct file_operations rtc_fops = { | 502 | static const struct file_operations rtc_fops = { |
503 | .owner = THIS_MODULE, | 503 | .owner = THIS_MODULE, |
504 | .ioctl = rtc_ioctl, | 504 | .ioctl = rtc_ioctl, |
505 | }; | 505 | }; |
diff --git a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c index 284ebfda03f..be35a70798a 100644 --- a/arch/cris/arch-v10/drivers/eeprom.c +++ b/arch/cris/arch-v10/drivers/eeprom.c | |||
@@ -172,7 +172,7 @@ static const char eeprom_name[] = "eeprom"; | |||
172 | static struct eeprom_type eeprom; | 172 | static struct eeprom_type eeprom; |
173 | 173 | ||
174 | /* This is the exported file-operations structure for this device. */ | 174 | /* This is the exported file-operations structure for this device. */ |
175 | struct file_operations eeprom_fops = | 175 | const struct file_operations eeprom_fops = |
176 | { | 176 | { |
177 | .llseek = eeprom_lseek, | 177 | .llseek = eeprom_lseek, |
178 | .read = eeprom_read, | 178 | .read = eeprom_read, |
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c index 9aba18b931d..f389ed6998f 100644 --- a/arch/cris/arch-v10/drivers/gpio.c +++ b/arch/cris/arch-v10/drivers/gpio.c | |||
@@ -838,7 +838,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) | |||
838 | return 0; | 838 | return 0; |
839 | } | 839 | } |
840 | 840 | ||
841 | struct file_operations gpio_fops = { | 841 | const struct file_operations gpio_fops = { |
842 | .owner = THIS_MODULE, | 842 | .owner = THIS_MODULE, |
843 | .poll = gpio_poll, | 843 | .poll = gpio_poll, |
844 | .ioctl = gpio_ioctl, | 844 | .ioctl = gpio_ioctl, |
diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c index 092c724a645..aca81ddaf60 100644 --- a/arch/cris/arch-v10/drivers/i2c.c +++ b/arch/cris/arch-v10/drivers/i2c.c | |||
@@ -692,7 +692,7 @@ i2c_ioctl(struct inode *inode, struct file *file, | |||
692 | return 0; | 692 | return 0; |
693 | } | 693 | } |
694 | 694 | ||
695 | static struct file_operations i2c_fops = { | 695 | static const struct file_operations i2c_fops = { |
696 | .owner = THIS_MODULE, | 696 | .owner = THIS_MODULE, |
697 | .ioctl = i2c_ioctl, | 697 | .ioctl = i2c_ioctl, |
698 | .open = i2c_open, | 698 | .open = i2c_open, |
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c index 8c830eefc89..107796e5014 100644 --- a/arch/cris/arch-v10/drivers/pcf8563.c +++ b/arch/cris/arch-v10/drivers/pcf8563.c | |||
@@ -56,7 +56,7 @@ static const unsigned char days_in_month[] = | |||
56 | 56 | ||
57 | int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 57 | int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); |
58 | 58 | ||
59 | static struct file_operations pcf8563_fops = { | 59 | static const struct file_operations pcf8563_fops = { |
60 | .owner = THIS_MODULE, | 60 | .owner = THIS_MODULE, |
61 | .ioctl = pcf8563_ioctl, | 61 | .ioctl = pcf8563_ioctl, |
62 | }; | 62 | }; |
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index 2449637e6fc..1a071f17446 100644 --- a/arch/cris/arch-v32/drivers/cryptocop.c +++ b/arch/cris/arch-v32/drivers/cryptocop.c | |||
@@ -266,7 +266,7 @@ static void print_user_dma_lists(struct cryptocop_dma_list_operation *dma_op); | |||
266 | 266 | ||
267 | 267 | ||
268 | 268 | ||
269 | struct file_operations cryptocop_fops = { | 269 | const struct file_operations cryptocop_fops = { |
270 | owner: THIS_MODULE, | 270 | owner: THIS_MODULE, |
271 | open: cryptocop_open, | 271 | open: cryptocop_open, |
272 | release: cryptocop_release, | 272 | release: cryptocop_release, |
diff --git a/arch/cris/arch-v32/drivers/gpio.c b/arch/cris/arch-v32/drivers/gpio.c index 08d36f0955c..d82c5c56113 100644 --- a/arch/cris/arch-v32/drivers/gpio.c +++ b/arch/cris/arch-v32/drivers/gpio.c | |||
@@ -705,7 +705,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) | |||
705 | return 0; | 705 | return 0; |
706 | } | 706 | } |
707 | 707 | ||
708 | struct file_operations gpio_fops = { | 708 | const struct file_operations gpio_fops = { |
709 | .owner = THIS_MODULE, | 709 | .owner = THIS_MODULE, |
710 | .poll = gpio_poll, | 710 | .poll = gpio_poll, |
711 | .ioctl = gpio_ioctl, | 711 | .ioctl = gpio_ioctl, |
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c index 95f00188c62..5d6c52737df 100644 --- a/arch/cris/arch-v32/drivers/i2c.c +++ b/arch/cris/arch-v32/drivers/i2c.c | |||
@@ -573,7 +573,7 @@ i2c_ioctl(struct inode *inode, struct file *file, | |||
573 | return 0; | 573 | return 0; |
574 | } | 574 | } |
575 | 575 | ||
576 | static struct file_operations i2c_fops = { | 576 | static const struct file_operations i2c_fops = { |
577 | owner: THIS_MODULE, | 577 | owner: THIS_MODULE, |
578 | ioctl: i2c_ioctl, | 578 | ioctl: i2c_ioctl, |
579 | open: i2c_open, | 579 | open: i2c_open, |
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index 2fc7d75a35d..544ab017941 100644 --- a/arch/cris/arch-v32/drivers/pcf8563.c +++ b/arch/cris/arch-v32/drivers/pcf8563.c | |||
@@ -50,7 +50,7 @@ int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | |||
50 | int pcf8563_open(struct inode *, struct file *); | 50 | int pcf8563_open(struct inode *, struct file *); |
51 | int pcf8563_release(struct inode *, struct file *); | 51 | int pcf8563_release(struct inode *, struct file *); |
52 | 52 | ||
53 | static struct file_operations pcf8563_fops = { | 53 | static const struct file_operations pcf8563_fops = { |
54 | owner: THIS_MODULE, | 54 | owner: THIS_MODULE, |
55 | ioctl: pcf8563_ioctl, | 55 | ioctl: pcf8563_ioctl, |
56 | open: pcf8563_open, | 56 | open: pcf8563_open, |
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 424eb0eb1cd..df89298aafc 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -187,7 +187,7 @@ static struct sync_port ports[]= | |||
187 | 187 | ||
188 | #define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port)) | 188 | #define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port)) |
189 | 189 | ||
190 | static struct file_operations sync_serial_fops = { | 190 | static const struct file_operations sync_serial_fops = { |
191 | .owner = THIS_MODULE, | 191 | .owner = THIS_MODULE, |
192 | .write = sync_serial_write, | 192 | .write = sync_serial_write, |
193 | .read = sync_serial_read, | 193 | .read = sync_serial_read, |
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c index f60ab785f23..4cfcae62050 100644 --- a/arch/cris/kernel/profile.c +++ b/arch/cris/kernel/profile.c | |||
@@ -50,7 +50,7 @@ write_cris_profile(struct file *file, const char __user *buf, | |||
50 | memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); | 50 | memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); |
51 | } | 51 | } |
52 | 52 | ||
53 | static struct file_operations cris_proc_profile_operations = { | 53 | static const struct file_operations cris_proc_profile_operations = { |
54 | .read = read_cris_profile, | 54 | .read = read_cris_profile, |
55 | .write = write_cris_profile, | 55 | .write = write_cris_profile, |
56 | }; | 56 | }; |
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index 19901692754..db99a8948da 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -1894,7 +1894,7 @@ static int __init apm_setup(char *str) | |||
1894 | __setup("apm=", apm_setup); | 1894 | __setup("apm=", apm_setup); |
1895 | #endif | 1895 | #endif |
1896 | 1896 | ||
1897 | static struct file_operations apm_bios_fops = { | 1897 | static const struct file_operations apm_bios_fops = { |
1898 | .owner = THIS_MODULE, | 1898 | .owner = THIS_MODULE, |
1899 | .read = do_read, | 1899 | .read = do_read, |
1900 | .poll = do_poll, | 1900 | .poll = do_poll, |
diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c index 5ae1705eafa..ee771f305f9 100644 --- a/arch/i386/kernel/cpu/mtrr/if.c +++ b/arch/i386/kernel/cpu/mtrr/if.c | |||
@@ -339,7 +339,7 @@ static int mtrr_open(struct inode *inode, struct file *file) | |||
339 | return single_open(file, mtrr_seq_show, NULL); | 339 | return single_open(file, mtrr_seq_show, NULL); |
340 | } | 340 | } |
341 | 341 | ||
342 | static struct file_operations mtrr_fops = { | 342 | static const struct file_operations mtrr_fops = { |
343 | .owner = THIS_MODULE, | 343 | .owner = THIS_MODULE, |
344 | .open = mtrr_open, | 344 | .open = mtrr_open, |
345 | .read = seq_read, | 345 | .read = seq_read, |
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c index 51130b39cd2..4da75fa3208 100644 --- a/arch/i386/kernel/cpuid.c +++ b/arch/i386/kernel/cpuid.c | |||
@@ -148,7 +148,7 @@ static int cpuid_open(struct inode *inode, struct file *file) | |||
148 | /* | 148 | /* |
149 | * File operations we support | 149 | * File operations we support |
150 | */ | 150 | */ |
151 | static struct file_operations cpuid_fops = { | 151 | static const struct file_operations cpuid_fops = { |
152 | .owner = THIS_MODULE, | 152 | .owner = THIS_MODULE, |
153 | .llseek = cpuid_seek, | 153 | .llseek = cpuid_seek, |
154 | .read = cpuid_read, | 154 | .read = cpuid_read, |
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index c8fa13721bc..381252bae3d 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c | |||
@@ -451,7 +451,7 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_ | |||
451 | return ret; | 451 | return ret; |
452 | } | 452 | } |
453 | 453 | ||
454 | static struct file_operations microcode_fops = { | 454 | static const struct file_operations microcode_fops = { |
455 | .owner = THIS_MODULE, | 455 | .owner = THIS_MODULE, |
456 | .write = microcode_write, | 456 | .write = microcode_write, |
457 | .open = microcode_open, | 457 | .open = microcode_open, |
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c index 4a472a17d1c..4e14264f392 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/i386/kernel/msr.c | |||
@@ -230,7 +230,7 @@ static int msr_open(struct inode *inode, struct file *file) | |||
230 | /* | 230 | /* |
231 | * File operations we support | 231 | * File operations we support |
232 | */ | 232 | */ |
233 | static struct file_operations msr_fops = { | 233 | static const struct file_operations msr_fops = { |
234 | .owner = THIS_MODULE, | 234 | .owner = THIS_MODULE, |
235 | .llseek = msr_seek, | 235 | .llseek = msr_seek, |
236 | .read = msr_read, | 236 | .read = msr_read, |
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index ce49fe3a3b5..c1dca226b47 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c | |||
@@ -1881,7 +1881,7 @@ ioc_open(struct inode *inode, struct file *file) | |||
1881 | return seq_open(file, &ioc_seq_ops); | 1881 | return seq_open(file, &ioc_seq_ops); |
1882 | } | 1882 | } |
1883 | 1883 | ||
1884 | static struct file_operations ioc_fops = { | 1884 | static const struct file_operations ioc_fops = { |
1885 | .open = ioc_open, | 1885 | .open = ioc_open, |
1886 | .read = seq_read, | 1886 | .read = seq_read, |
1887 | .llseek = seq_lseek, | 1887 | .llseek = seq_lseek, |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 86e144f321f..9860794a68f 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -621,7 +621,7 @@ EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info); | |||
621 | 621 | ||
622 | 622 | ||
623 | /* forward declaration */ | 623 | /* forward declaration */ |
624 | static struct file_operations pfm_file_ops; | 624 | static const struct file_operations pfm_file_ops; |
625 | 625 | ||
626 | /* | 626 | /* |
627 | * forward declarations | 627 | * forward declarations |
@@ -2126,7 +2126,7 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare) | |||
2126 | 2126 | ||
2127 | 2127 | ||
2128 | 2128 | ||
2129 | static struct file_operations pfm_file_ops = { | 2129 | static const struct file_operations pfm_file_ops = { |
2130 | .llseek = no_llseek, | 2130 | .llseek = no_llseek, |
2131 | .read = pfm_read, | 2131 | .read = pfm_read, |
2132 | .write = pfm_write, | 2132 | .write = pfm_write, |
@@ -6596,7 +6596,7 @@ found: | |||
6596 | return 0; | 6596 | return 0; |
6597 | } | 6597 | } |
6598 | 6598 | ||
6599 | static struct file_operations pfm_proc_fops = { | 6599 | static const struct file_operations pfm_proc_fops = { |
6600 | .open = pfm_proc_open, | 6600 | .open = pfm_proc_open, |
6601 | .read = seq_read, | 6601 | .read = seq_read, |
6602 | .llseek = seq_lseek, | 6602 | .llseek = seq_lseek, |
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index e375a2f0f2c..af9f8754d84 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c | |||
@@ -352,7 +352,7 @@ retry: | |||
352 | return size; | 352 | return size; |
353 | } | 353 | } |
354 | 354 | ||
355 | static struct file_operations salinfo_event_fops = { | 355 | static const struct file_operations salinfo_event_fops = { |
356 | .open = salinfo_event_open, | 356 | .open = salinfo_event_open, |
357 | .read = salinfo_event_read, | 357 | .read = salinfo_event_read, |
358 | }; | 358 | }; |
@@ -568,7 +568,7 @@ salinfo_log_write(struct file *file, const char __user *buffer, size_t count, lo | |||
568 | return count; | 568 | return count; |
569 | } | 569 | } |
570 | 570 | ||
571 | static struct file_operations salinfo_data_fops = { | 571 | static const struct file_operations salinfo_data_fops = { |
572 | .open = salinfo_log_open, | 572 | .open = salinfo_log_open, |
573 | .release = salinfo_log_release, | 573 | .release = salinfo_log_release, |
574 | .read = salinfo_log_read, | 574 | .read = salinfo_log_read, |
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c index d9d306c79f2..601747b1e22 100644 --- a/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c | |||
@@ -455,7 +455,7 @@ static int sn2_ptc_proc_open(struct inode *inode, struct file *file) | |||
455 | return seq_open(file, &sn2_ptc_seq_ops); | 455 | return seq_open(file, &sn2_ptc_seq_ops); |
456 | } | 456 | } |
457 | 457 | ||
458 | static struct file_operations proc_sn2_ptc_operations = { | 458 | static const struct file_operations proc_sn2_ptc_operations = { |
459 | .open = sn2_ptc_proc_open, | 459 | .open = sn2_ptc_proc_open, |
460 | .read = seq_read, | 460 | .read = seq_read, |
461 | .llseek = seq_lseek, | 461 | .llseek = seq_lseek, |
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 33367996d72..6da9854751c 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c | |||
@@ -865,7 +865,7 @@ error: | |||
865 | return r; | 865 | return r; |
866 | } | 866 | } |
867 | 867 | ||
868 | static struct file_operations sn_hwperf_fops = { | 868 | static const struct file_operations sn_hwperf_fops = { |
869 | .ioctl = sn_hwperf_ioctl, | 869 | .ioctl = sn_hwperf_ioctl, |
870 | }; | 870 | }; |
871 | 871 | ||
diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c index 15c16b62dff..a812d03879f 100644 --- a/arch/m68k/bvme6000/rtc.c +++ b/arch/m68k/bvme6000/rtc.c | |||
@@ -159,7 +159,7 @@ static int rtc_release(struct inode *inode, struct file *file) | |||
159 | * The various file operations we support. | 159 | * The various file operations we support. |
160 | */ | 160 | */ |
161 | 161 | ||
162 | static struct file_operations rtc_fops = { | 162 | static const struct file_operations rtc_fops = { |
163 | .ioctl = rtc_ioctl, | 163 | .ioctl = rtc_ioctl, |
164 | .open = rtc_open, | 164 | .open = rtc_open, |
165 | .release = rtc_release, | 165 | .release = rtc_release, |
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c index b0e4c084df8..272d47eac58 100644 --- a/arch/m68k/mvme16x/rtc.c +++ b/arch/m68k/mvme16x/rtc.c | |||
@@ -147,7 +147,7 @@ static int rtc_release(struct inode *inode, struct file *file) | |||
147 | * The various file operations we support. | 147 | * The various file operations we support. |
148 | */ | 148 | */ |
149 | 149 | ||
150 | static struct file_operations rtc_fops = { | 150 | static const struct file_operations rtc_fops = { |
151 | .ioctl = rtc_ioctl, | 151 | .ioctl = rtc_ioctl, |
152 | .open = rtc_open, | 152 | .open = rtc_open, |
153 | .release = rtc_release, | 153 | .release = rtc_release, |
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index f29e93c6ccf..d92c48e0d7a 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -478,7 +478,7 @@ static ssize_t file_write(struct file *file, const char __user * buffer, | |||
478 | return rtlx_write(minor, (void *)buffer, count, 1); | 478 | return rtlx_write(minor, (void *)buffer, count, 1); |
479 | } | 479 | } |
480 | 480 | ||
481 | static struct file_operations rtlx_fops = { | 481 | static const struct file_operations rtlx_fops = { |
482 | .owner = THIS_MODULE, | 482 | .owner = THIS_MODULE, |
483 | .open = file_open, | 483 | .open = file_open, |
484 | .release = file_release, | 484 | .release = file_release, |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 4e832da48c6..9aca871a307 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -1208,7 +1208,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer, | |||
1208 | return ret; | 1208 | return ret; |
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | static struct file_operations vpe_fops = { | 1211 | static const struct file_operations vpe_fops = { |
1212 | .owner = THIS_MODULE, | 1212 | .owner = THIS_MODULE, |
1213 | .open = vpe_open, | 1213 | .open = vpe_open, |
1214 | .release = vpe_release, | 1214 | .release = vpe_release, |
diff --git a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c index d1a906e683b..212547c5731 100644 --- a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c +++ b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c | |||
@@ -374,7 +374,7 @@ static long sbprof_tb_ioctl(struct file *filp, | |||
374 | return error; | 374 | return error; |
375 | } | 375 | } |
376 | 376 | ||
377 | static struct file_operations sbprof_tb_fops = { | 377 | static const struct file_operations sbprof_tb_fops = { |
378 | .owner = THIS_MODULE, | 378 | .owner = THIS_MODULE, |
379 | .open = sbprof_tb_open, | 379 | .open = sbprof_tb_open, |
380 | .release = sbprof_tb_release, | 380 | .release = sbprof_tb_release, |
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index ac8ee205c35..a46bc62b643 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c | |||
@@ -479,7 +479,7 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
479 | return error; | 479 | return error; |
480 | } | 480 | } |
481 | 481 | ||
482 | static struct file_operations perf_fops = { | 482 | static const struct file_operations perf_fops = { |
483 | .llseek = no_llseek, | 483 | .llseek = no_llseek, |
484 | .read = perf_read, | 484 | .read = perf_read, |
485 | .write = perf_write, | 485 | .write = perf_write, |
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 0de5a08cf9b..89486b63128 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -571,7 +571,7 @@ static int lparcfg_open(struct inode *inode, struct file *file) | |||
571 | return single_open(file, lparcfg_data, NULL); | 571 | return single_open(file, lparcfg_data, NULL); |
572 | } | 572 | } |
573 | 573 | ||
574 | struct file_operations lparcfg_fops = { | 574 | const struct file_operations lparcfg_fops = { |
575 | .owner = THIS_MODULE, | 575 | .owner = THIS_MODULE, |
576 | .read = seq_read, | 576 | .read = seq_read, |
577 | .write = lparcfg_write, | 577 | .write = lparcfg_write, |
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 869cebbba96..f9676f52c6d 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c | |||
@@ -179,7 +179,7 @@ static int dev_nvram_ioctl(struct inode *inode, struct file *file, | |||
179 | } | 179 | } |
180 | } | 180 | } |
181 | 181 | ||
182 | struct file_operations nvram_fops = { | 182 | const struct file_operations nvram_fops = { |
183 | .owner = THIS_MODULE, | 183 | .owner = THIS_MODULE, |
184 | .llseek = dev_nvram_llseek, | 184 | .llseek = dev_nvram_llseek, |
185 | .read = dev_nvram_read, | 185 | .read = dev_nvram_read, |
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c index 3d437c32546..f78dfce1b77 100644 --- a/arch/powerpc/kernel/proc_ppc64.c +++ b/arch/powerpc/kernel/proc_ppc64.c | |||
@@ -33,7 +33,7 @@ static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes | |||
33 | loff_t *ppos); | 33 | loff_t *ppos); |
34 | static int page_map_mmap( struct file *file, struct vm_area_struct *vma ); | 34 | static int page_map_mmap( struct file *file, struct vm_area_struct *vma ); |
35 | 35 | ||
36 | static struct file_operations page_map_fops = { | 36 | static const struct file_operations page_map_fops = { |
37 | .llseek = page_map_seek, | 37 | .llseek = page_map_seek, |
38 | .read = page_map_read, | 38 | .read = page_map_read, |
39 | .mmap = page_map_mmap | 39 | .mmap = page_map_mmap |
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index 2fe82abf1c5..6cbf2ae5d7a 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c | |||
@@ -160,7 +160,7 @@ static int sensors_open(struct inode *inode, struct file *file) | |||
160 | return single_open(file, ppc_rtas_sensors_show, NULL); | 160 | return single_open(file, ppc_rtas_sensors_show, NULL); |
161 | } | 161 | } |
162 | 162 | ||
163 | struct file_operations ppc_rtas_sensors_operations = { | 163 | const struct file_operations ppc_rtas_sensors_operations = { |
164 | .open = sensors_open, | 164 | .open = sensors_open, |
165 | .read = seq_read, | 165 | .read = seq_read, |
166 | .llseek = seq_lseek, | 166 | .llseek = seq_lseek, |
@@ -172,7 +172,7 @@ static int poweron_open(struct inode *inode, struct file *file) | |||
172 | return single_open(file, ppc_rtas_poweron_show, NULL); | 172 | return single_open(file, ppc_rtas_poweron_show, NULL); |
173 | } | 173 | } |
174 | 174 | ||
175 | struct file_operations ppc_rtas_poweron_operations = { | 175 | const struct file_operations ppc_rtas_poweron_operations = { |
176 | .open = poweron_open, | 176 | .open = poweron_open, |
177 | .read = seq_read, | 177 | .read = seq_read, |
178 | .llseek = seq_lseek, | 178 | .llseek = seq_lseek, |
@@ -185,7 +185,7 @@ static int progress_open(struct inode *inode, struct file *file) | |||
185 | return single_open(file, ppc_rtas_progress_show, NULL); | 185 | return single_open(file, ppc_rtas_progress_show, NULL); |
186 | } | 186 | } |
187 | 187 | ||
188 | struct file_operations ppc_rtas_progress_operations = { | 188 | const struct file_operations ppc_rtas_progress_operations = { |
189 | .open = progress_open, | 189 | .open = progress_open, |
190 | .read = seq_read, | 190 | .read = seq_read, |
191 | .llseek = seq_lseek, | 191 | .llseek = seq_lseek, |
@@ -198,7 +198,7 @@ static int clock_open(struct inode *inode, struct file *file) | |||
198 | return single_open(file, ppc_rtas_clock_show, NULL); | 198 | return single_open(file, ppc_rtas_clock_show, NULL); |
199 | } | 199 | } |
200 | 200 | ||
201 | struct file_operations ppc_rtas_clock_operations = { | 201 | const struct file_operations ppc_rtas_clock_operations = { |
202 | .open = clock_open, | 202 | .open = clock_open, |
203 | .read = seq_read, | 203 | .read = seq_read, |
204 | .llseek = seq_lseek, | 204 | .llseek = seq_lseek, |
@@ -211,7 +211,7 @@ static int tone_freq_open(struct inode *inode, struct file *file) | |||
211 | return single_open(file, ppc_rtas_tone_freq_show, NULL); | 211 | return single_open(file, ppc_rtas_tone_freq_show, NULL); |
212 | } | 212 | } |
213 | 213 | ||
214 | struct file_operations ppc_rtas_tone_freq_operations = { | 214 | const struct file_operations ppc_rtas_tone_freq_operations = { |
215 | .open = tone_freq_open, | 215 | .open = tone_freq_open, |
216 | .read = seq_read, | 216 | .read = seq_read, |
217 | .llseek = seq_lseek, | 217 | .llseek = seq_lseek, |
@@ -224,7 +224,7 @@ static int tone_volume_open(struct inode *inode, struct file *file) | |||
224 | return single_open(file, ppc_rtas_tone_volume_show, NULL); | 224 | return single_open(file, ppc_rtas_tone_volume_show, NULL); |
225 | } | 225 | } |
226 | 226 | ||
227 | struct file_operations ppc_rtas_tone_volume_operations = { | 227 | const struct file_operations ppc_rtas_tone_volume_operations = { |
228 | .open = tone_volume_open, | 228 | .open = tone_volume_open, |
229 | .read = seq_read, | 229 | .read = seq_read, |
230 | .llseek = seq_lseek, | 230 | .llseek = seq_lseek, |
@@ -237,7 +237,7 @@ static int rmo_buf_open(struct inode *inode, struct file *file) | |||
237 | return single_open(file, ppc_rtas_rmo_buf_show, NULL); | 237 | return single_open(file, ppc_rtas_rmo_buf_show, NULL); |
238 | } | 238 | } |
239 | 239 | ||
240 | struct file_operations ppc_rtas_rmo_buf_ops = { | 240 | const struct file_operations ppc_rtas_rmo_buf_ops = { |
241 | .open = rmo_buf_open, | 241 | .open = rmo_buf_open, |
242 | .read = seq_read, | 242 | .read = seq_read, |
243 | .llseek = seq_lseek, | 243 | .llseek = seq_lseek, |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 65e4ebe8db3..f72118c0844 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -702,7 +702,7 @@ static int initialize_flash_pde_data(const char *rtas_call_name, | |||
702 | } | 702 | } |
703 | 703 | ||
704 | static struct proc_dir_entry *create_flash_pde(const char *filename, | 704 | static struct proc_dir_entry *create_flash_pde(const char *filename, |
705 | struct file_operations *fops) | 705 | const struct file_operations *fops) |
706 | { | 706 | { |
707 | struct proc_dir_entry *ent = NULL; | 707 | struct proc_dir_entry *ent = NULL; |
708 | 708 | ||
@@ -715,21 +715,21 @@ static struct proc_dir_entry *create_flash_pde(const char *filename, | |||
715 | return ent; | 715 | return ent; |
716 | } | 716 | } |
717 | 717 | ||
718 | static struct file_operations rtas_flash_operations = { | 718 | static const struct file_operations rtas_flash_operations = { |
719 | .read = rtas_flash_read, | 719 | .read = rtas_flash_read, |
720 | .write = rtas_flash_write, | 720 | .write = rtas_flash_write, |
721 | .open = rtas_excl_open, | 721 | .open = rtas_excl_open, |
722 | .release = rtas_flash_release, | 722 | .release = rtas_flash_release, |
723 | }; | 723 | }; |
724 | 724 | ||
725 | static struct file_operations manage_flash_operations = { | 725 | static const struct file_operations manage_flash_operations = { |
726 | .read = manage_flash_read, | 726 | .read = manage_flash_read, |
727 | .write = manage_flash_write, | 727 | .write = manage_flash_write, |
728 | .open = rtas_excl_open, | 728 | .open = rtas_excl_open, |
729 | .release = rtas_excl_release, | 729 | .release = rtas_excl_release, |
730 | }; | 730 | }; |
731 | 731 | ||
732 | static struct file_operations validate_flash_operations = { | 732 | static const struct file_operations validate_flash_operations = { |
733 | .read = validate_flash_read, | 733 | .read = validate_flash_read, |
734 | .write = validate_flash_write, | 734 | .write = validate_flash_write, |
735 | .open = rtas_excl_open, | 735 | .open = rtas_excl_open, |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 347eff56fcb..af9e9455a70 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 738b9244382..bffc934cead 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 c1f4502a3c6..91df52a1899 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 90d3d49f713..b1187d95e3b 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 b54e37101e6..f2cde418020 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 a6799ed34a6..e2100ece9c6 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 9437f48cc9e..6cedbc002e0 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 3ddc04925d5..eae51ef9af2 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 789a5e99aef..5aa97aff339 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 8ca2612221d..77d0937d5c0 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 45368a57d7d..8e1ef168e2d 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, |
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c index 684ed04eb8b..a956f28ab16 100644 --- a/arch/ppc/8xx_io/cs4218_tdm.c +++ b/arch/ppc/8xx_io/cs4218_tdm.c | |||
@@ -1711,7 +1711,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd, | |||
1711 | } | 1711 | } |
1712 | 1712 | ||
1713 | 1713 | ||
1714 | static struct file_operations mixer_fops = | 1714 | static const struct file_operations mixer_fops = |
1715 | { | 1715 | { |
1716 | .owner = THIS_MODULE, | 1716 | .owner = THIS_MODULE, |
1717 | .llseek = sound_lseek, | 1717 | .llseek = sound_lseek, |
@@ -2298,7 +2298,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd, | |||
2298 | 2298 | ||
2299 | 2299 | ||
2300 | 2300 | ||
2301 | static struct file_operations sq_fops = | 2301 | static const struct file_operations sq_fops = |
2302 | { | 2302 | { |
2303 | .owner = THIS_MODULE, | 2303 | .owner = THIS_MODULE, |
2304 | .llseek = sound_lseek, | 2304 | .llseek = sound_lseek, |
@@ -2433,7 +2433,7 @@ static ssize_t state_read(struct file *file, char *buf, size_t count, | |||
2433 | } | 2433 | } |
2434 | 2434 | ||
2435 | 2435 | ||
2436 | static struct file_operations state_fops = | 2436 | static const struct file_operations state_fops = |
2437 | { | 2437 | { |
2438 | .owner = THIS_MODULE, | 2438 | .owner = THIS_MODULE, |
2439 | .llseek = sound_lseek, | 2439 | .llseek = sound_lseek, |
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index a4fda7b5364..ba5d3167df0 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -34,7 +34,7 @@ struct hypfs_sb_info { | |||
34 | struct mutex lock; /* lock to protect update process */ | 34 | struct mutex lock; /* lock to protect update process */ |
35 | }; | 35 | }; |
36 | 36 | ||
37 | static struct file_operations hypfs_file_ops; | 37 | static const struct file_operations hypfs_file_ops; |
38 | static struct file_system_type hypfs_type; | 38 | static struct file_system_type hypfs_type; |
39 | static struct super_operations hypfs_s_ops; | 39 | static struct super_operations hypfs_s_ops; |
40 | 40 | ||
@@ -440,7 +440,7 @@ struct dentry *hypfs_create_str(struct super_block *sb, struct dentry *dir, | |||
440 | return dentry; | 440 | return dentry; |
441 | } | 441 | } |
442 | 442 | ||
443 | static struct file_operations hypfs_file_ops = { | 443 | static const struct file_operations hypfs_file_ops = { |
444 | .open = hypfs_open, | 444 | .open = hypfs_open, |
445 | .release = hypfs_release, | 445 | .release = hypfs_release, |
446 | .read = do_sync_read, | 446 | .read = do_sync_read, |
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index f4b62df02aa..51653d82d7d 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
@@ -167,7 +167,7 @@ static DECLARE_MUTEX(debug_lock); | |||
167 | 167 | ||
168 | static int initialized; | 168 | static int initialized; |
169 | 169 | ||
170 | static struct file_operations debug_file_ops = { | 170 | static const struct file_operations debug_file_ops = { |
171 | .owner = THIS_MODULE, | 171 | .owner = THIS_MODULE, |
172 | .read = debug_output, | 172 | .read = debug_output, |
173 | .write = debug_input, | 173 | .write = debug_input, |
diff --git a/arch/sh/boards/landisk/landisk_pwb.c b/arch/sh/boards/landisk/landisk_pwb.c index e6252497816..47a63c6617e 100644 --- a/arch/sh/boards/landisk/landisk_pwb.c +++ b/arch/sh/boards/landisk/landisk_pwb.c | |||
@@ -150,7 +150,7 @@ static irqreturn_t sw_interrupt(int irq, void *dev_id) | |||
150 | return IRQ_HANDLED; | 150 | return IRQ_HANDLED; |
151 | } | 151 | } |
152 | 152 | ||
153 | static struct file_operations swdrv_fops = { | 153 | static const struct file_operations swdrv_fops = { |
154 | .read = swdrv_read, /* read */ | 154 | .read = swdrv_read, /* read */ |
155 | .write = swdrv_write, /* write */ | 155 | .write = swdrv_write, /* write */ |
156 | .open = swdrv_open, /* open */ | 156 | .open = swdrv_open, /* open */ |
diff --git a/arch/sh/mm/cache-debugfs.c b/arch/sh/mm/cache-debugfs.c index e0122bd33dd..909dcfa8c8c 100644 --- a/arch/sh/mm/cache-debugfs.c +++ b/arch/sh/mm/cache-debugfs.c | |||
@@ -114,7 +114,7 @@ static int cache_debugfs_open(struct inode *inode, struct file *file) | |||
114 | return single_open(file, cache_seq_show, inode->i_private); | 114 | return single_open(file, cache_seq_show, inode->i_private); |
115 | } | 115 | } |
116 | 116 | ||
117 | static struct file_operations cache_debugfs_fops = { | 117 | static const struct file_operations cache_debugfs_fops = { |
118 | .owner = THIS_MODULE, | 118 | .owner = THIS_MODULE, |
119 | .open = cache_debugfs_open, | 119 | .open = cache_debugfs_open, |
120 | .read = seq_read, | 120 | .read = seq_read, |
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index b60ad83a763..d0d45e2e0ab 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c | |||
@@ -378,7 +378,7 @@ static int pmb_debugfs_open(struct inode *inode, struct file *file) | |||
378 | return single_open(file, pmb_seq_show, NULL); | 378 | return single_open(file, pmb_seq_show, NULL); |
379 | } | 379 | } |
380 | 380 | ||
381 | static struct file_operations pmb_debugfs_fops = { | 381 | static const struct file_operations pmb_debugfs_fops = { |
382 | .owner = THIS_MODULE, | 382 | .owner = THIS_MODULE, |
383 | .open = pmb_debugfs_open, | 383 | .open = pmb_debugfs_open, |
384 | .read = seq_read, | 384 | .read = seq_read, |
diff --git a/arch/sh/oprofile/op_model_sh7750.c b/arch/sh/oprofile/op_model_sh7750.c index 60402eec4b4..0104e44bc76 100644 --- a/arch/sh/oprofile/op_model_sh7750.c +++ b/arch/sh/oprofile/op_model_sh7750.c | |||
@@ -187,7 +187,7 @@ static ssize_t sh7750_write_count(struct file *file, const char __user *buf, | |||
187 | return count; | 187 | return count; |
188 | } | 188 | } |
189 | 189 | ||
190 | static struct file_operations count_fops = { | 190 | static const struct file_operations count_fops = { |
191 | .read = sh7750_read_count, | 191 | .read = sh7750_read_count, |
192 | .write = sh7750_write_count, | 192 | .write = sh7750_write_count, |
193 | }; | 193 | }; |
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c index 406dd94afb4..d06a405ca71 100644 --- a/arch/sparc/kernel/apc.c +++ b/arch/sparc/kernel/apc.c | |||
@@ -127,7 +127,7 @@ static int apc_ioctl(struct inode *inode, struct file *f, | |||
127 | return 0; | 127 | return 0; |
128 | } | 128 | } |
129 | 129 | ||
130 | static struct file_operations apc_fops = { | 130 | static const struct file_operations apc_fops = { |
131 | .ioctl = apc_ioctl, | 131 | .ioctl = apc_ioctl, |
132 | .open = apc_open, | 132 | .open = apc_open, |
133 | .release = apc_release, | 133 | .release = apc_release, |
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index 061e1b1fa58..f84da4f1b70 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c | |||
@@ -1327,7 +1327,7 @@ static int mini_rtc_release(struct inode *inode, struct file *file) | |||
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | 1329 | ||
1330 | static struct file_operations mini_rtc_fops = { | 1330 | static const struct file_operations mini_rtc_fops = { |
1331 | .owner = THIS_MODULE, | 1331 | .owner = THIS_MODULE, |
1332 | .ioctl = mini_rtc_ioctl, | 1332 | .ioctl = mini_rtc_ioctl, |
1333 | .open = mini_rtc_open, | 1333 | .open = mini_rtc_open, |
diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c index 89a4757f192..c2864447de8 100644 --- a/arch/sparc64/solaris/socksys.c +++ b/arch/sparc64/solaris/socksys.c | |||
@@ -163,7 +163,7 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait) | |||
163 | return mask; | 163 | return mask; |
164 | } | 164 | } |
165 | 165 | ||
166 | static struct file_operations socksys_fops = { | 166 | static const struct file_operations socksys_fops = { |
167 | .open = socksys_open, | 167 | .open = socksys_open, |
168 | .release = socksys_release, | 168 | .release = socksys_release, |
169 | }; | 169 | }; |
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c index 73c5caa7a15..55601687b3b 100644 --- a/arch/um/drivers/harddog_kern.c +++ b/arch/um/drivers/harddog_kern.c | |||
@@ -145,7 +145,7 @@ static int harddog_ioctl(struct inode *inode, struct file *file, | |||
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | static struct file_operations harddog_fops = { | 148 | static const struct file_operations harddog_fops = { |
149 | .owner = THIS_MODULE, | 149 | .owner = THIS_MODULE, |
150 | .write = harddog_write, | 150 | .write = harddog_write, |
151 | .ioctl = harddog_ioctl, | 151 | .ioctl = harddog_ioctl, |
diff --git a/arch/v850/kernel/rte_cb_leds.c b/arch/v850/kernel/rte_cb_leds.c index 996bd4f33ec..aa47ab1dcd8 100644 --- a/arch/v850/kernel/rte_cb_leds.c +++ b/arch/v850/kernel/rte_cb_leds.c | |||
@@ -117,7 +117,7 @@ static loff_t leds_dev_lseek (struct file *file, loff_t offs, int whence) | |||
117 | return 0; | 117 | return 0; |
118 | } | 118 | } |
119 | 119 | ||
120 | static struct file_operations leds_fops = { | 120 | static const struct file_operations leds_fops = { |
121 | .read = leds_dev_read, | 121 | .read = leds_dev_read, |
122 | .write = leds_dev_write, | 122 | .write = leds_dev_write, |
123 | .llseek = leds_dev_lseek | 123 | .llseek = leds_dev_lseek |
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index ac085038af2..bdb54a2c9f1 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c | |||
@@ -516,7 +516,7 @@ static int mce_ioctl(struct inode *i, struct file *f,unsigned int cmd, unsigned | |||
516 | } | 516 | } |
517 | } | 517 | } |
518 | 518 | ||
519 | static struct file_operations mce_chrdev_ops = { | 519 | static const struct file_operations mce_chrdev_ops = { |
520 | .read = mce_read, | 520 | .read = mce_read, |
521 | .ioctl = mce_ioctl, | 521 | .ioctl = mce_ioctl, |
522 | }; | 522 | }; |