Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Arjan van de Ven and committed by
Linus Torvalds
5dfe4c96 54047320

+94 -94
+1 -1
arch/arm/common/rtctime.c
··· 329 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 333 .owner = THIS_MODULE, 334 334 .llseek = no_llseek, 335 335 .read = rtc_read,
+1 -1
arch/arm/mach-at91rm9200/clock.c
··· 407 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 411 .open = at91_clk_open, 412 412 .read = seq_read, 413 413 .llseek = seq_lseek,
+1 -1
arch/avr32/mm/tlb.c
··· 360 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 364 .open = tlb_open, 365 365 .read = seq_read, 366 366 .llseek = seq_lseek,
+1 -1
arch/cris/arch-v10/drivers/ds1302.c
··· 499 499 500 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 503 .owner = THIS_MODULE, 504 504 .ioctl = rtc_ioctl, 505 505 };
+1 -1
arch/cris/arch-v10/drivers/eeprom.c
··· 172 172 static struct eeprom_type eeprom; 173 173 174 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 177 .llseek = eeprom_lseek, 178 178 .read = eeprom_read,
+1 -1
arch/cris/arch-v10/drivers/gpio.c
··· 838 838 return 0; 839 839 } 840 840 841 - struct file_operations gpio_fops = { 841 + const struct file_operations gpio_fops = { 842 842 .owner = THIS_MODULE, 843 843 .poll = gpio_poll, 844 844 .ioctl = gpio_ioctl,
+1 -1
arch/cris/arch-v10/drivers/i2c.c
··· 692 692 return 0; 693 693 } 694 694 695 - static struct file_operations i2c_fops = { 695 + static const struct file_operations i2c_fops = { 696 696 .owner = THIS_MODULE, 697 697 .ioctl = i2c_ioctl, 698 698 .open = i2c_open,
+1 -1
arch/cris/arch-v10/drivers/pcf8563.c
··· 56 56 57 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 60 .owner = THIS_MODULE, 61 61 .ioctl = pcf8563_ioctl, 62 62 };
+1 -1
arch/cris/arch-v32/drivers/cryptocop.c
··· 266 266 267 267 268 268 269 - struct file_operations cryptocop_fops = { 269 + const struct file_operations cryptocop_fops = { 270 270 owner: THIS_MODULE, 271 271 open: cryptocop_open, 272 272 release: cryptocop_release,
+1 -1
arch/cris/arch-v32/drivers/gpio.c
··· 705 705 return 0; 706 706 } 707 707 708 - struct file_operations gpio_fops = { 708 + const struct file_operations gpio_fops = { 709 709 .owner = THIS_MODULE, 710 710 .poll = gpio_poll, 711 711 .ioctl = gpio_ioctl,
+1 -1
arch/cris/arch-v32/drivers/i2c.c
··· 573 573 return 0; 574 574 } 575 575 576 - static struct file_operations i2c_fops = { 576 + static const struct file_operations i2c_fops = { 577 577 owner: THIS_MODULE, 578 578 ioctl: i2c_ioctl, 579 579 open: i2c_open,
+1 -1
arch/cris/arch-v32/drivers/pcf8563.c
··· 50 50 int pcf8563_open(struct inode *, struct file *); 51 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 54 owner: THIS_MODULE, 55 55 ioctl: pcf8563_ioctl, 56 56 open: pcf8563_open,
+1 -1
arch/cris/arch-v32/drivers/sync_serial.c
··· 187 187 188 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 191 .owner = THIS_MODULE, 192 192 .write = sync_serial_write, 193 193 .read = sync_serial_read,
+1 -1
arch/cris/kernel/profile.c
··· 50 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 54 .read = read_cris_profile, 55 55 .write = write_cris_profile, 56 56 };
+1 -1
arch/i386/kernel/apm.c
··· 1894 1894 __setup("apm=", apm_setup); 1895 1895 #endif 1896 1896 1897 - static struct file_operations apm_bios_fops = { 1897 + static const struct file_operations apm_bios_fops = { 1898 1898 .owner = THIS_MODULE, 1899 1899 .read = do_read, 1900 1900 .poll = do_poll,
+1 -1
arch/i386/kernel/cpu/mtrr/if.c
··· 339 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 343 .owner = THIS_MODULE, 344 344 .open = mtrr_open, 345 345 .read = seq_read,
+1 -1
arch/i386/kernel/cpuid.c
··· 148 148 /* 149 149 * File operations we support 150 150 */ 151 - static struct file_operations cpuid_fops = { 151 + static const struct file_operations cpuid_fops = { 152 152 .owner = THIS_MODULE, 153 153 .llseek = cpuid_seek, 154 154 .read = cpuid_read,
+1 -1
arch/i386/kernel/microcode.c
··· 451 451 return ret; 452 452 } 453 453 454 - static struct file_operations microcode_fops = { 454 + static const struct file_operations microcode_fops = { 455 455 .owner = THIS_MODULE, 456 456 .write = microcode_write, 457 457 .open = microcode_open,
+1 -1
arch/i386/kernel/msr.c
··· 230 230 /* 231 231 * File operations we support 232 232 */ 233 - static struct file_operations msr_fops = { 233 + static const struct file_operations msr_fops = { 234 234 .owner = THIS_MODULE, 235 235 .llseek = msr_seek, 236 236 .read = msr_read,
+1 -1
arch/ia64/hp/common/sba_iommu.c
··· 1881 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 1885 .open = ioc_open, 1886 1886 .read = seq_read, 1887 1887 .llseek = seq_lseek,
+3 -3
arch/ia64/kernel/perfmon.c
··· 621 621 622 622 623 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 627 * forward declarations ··· 2126 2126 2127 2127 2128 2128 2129 - static struct file_operations pfm_file_ops = { 2129 + static const struct file_operations pfm_file_ops = { 2130 2130 .llseek = no_llseek, 2131 2131 .read = pfm_read, 2132 2132 .write = pfm_write, ··· 6596 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 6600 .open = pfm_proc_open, 6601 6601 .read = seq_read, 6602 6602 .llseek = seq_lseek,
+2 -2
arch/ia64/kernel/salinfo.c
··· 352 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 356 .open = salinfo_event_open, 357 357 .read = salinfo_event_read, 358 358 }; ··· 568 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 572 .open = salinfo_log_open, 573 573 .release = salinfo_log_release, 574 574 .read = salinfo_log_read,
+1 -1
arch/ia64/sn/kernel/sn2/sn2_smp.c
··· 455 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 459 .open = sn2_ptc_proc_open, 460 460 .read = seq_read, 461 461 .llseek = seq_lseek,
+1 -1
arch/ia64/sn/kernel/sn2/sn_hwperf.c
··· 865 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 869 .ioctl = sn_hwperf_ioctl, 870 870 }; 871 871
+1 -1
arch/m68k/bvme6000/rtc.c
··· 159 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 163 .ioctl = rtc_ioctl, 164 164 .open = rtc_open, 165 165 .release = rtc_release,
+1 -1
arch/m68k/mvme16x/rtc.c
··· 147 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 151 .ioctl = rtc_ioctl, 152 152 .open = rtc_open, 153 153 .release = rtc_release,
+1 -1
arch/mips/kernel/rtlx.c
··· 478 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 482 .owner = THIS_MODULE, 483 483 .open = file_open, 484 484 .release = file_release,
+1 -1
arch/mips/kernel/vpe.c
··· 1208 1208 return ret; 1209 1209 } 1210 1210 1211 - static struct file_operations vpe_fops = { 1211 + static const struct file_operations vpe_fops = { 1212 1212 .owner = THIS_MODULE, 1213 1213 .open = vpe_open, 1214 1214 .release = vpe_release,
+1 -1
arch/mips/sibyte/sb1250/bcm1250_tbprof.c
··· 374 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 378 .owner = THIS_MODULE, 379 379 .open = sbprof_tb_open, 380 380 .release = sbprof_tb_release,
+1 -1
arch/parisc/kernel/perf.c
··· 479 479 return error; 480 480 } 481 481 482 - static struct file_operations perf_fops = { 482 + static const struct file_operations perf_fops = { 483 483 .llseek = no_llseek, 484 484 .read = perf_read, 485 485 .write = perf_write,
+1 -1
arch/powerpc/kernel/lparcfg.c
··· 571 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 575 .owner = THIS_MODULE, 576 576 .read = seq_read, 577 577 .write = lparcfg_write,
+1 -1
arch/powerpc/kernel/nvram_64.c
··· 179 179 } 180 180 } 181 181 182 - struct file_operations nvram_fops = { 182 + const struct file_operations nvram_fops = { 183 183 .owner = THIS_MODULE, 184 184 .llseek = dev_nvram_llseek, 185 185 .read = dev_nvram_read,
+1 -1
arch/powerpc/kernel/proc_ppc64.c
··· 33 33 loff_t *ppos); 34 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 37 .llseek = page_map_seek, 38 38 .read = page_map_read, 39 39 .mmap = page_map_mmap
+7 -7
arch/powerpc/kernel/rtas-proc.c
··· 160 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 164 .open = sensors_open, 165 165 .read = seq_read, 166 166 .llseek = seq_lseek, ··· 172 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 176 .open = poweron_open, 177 177 .read = seq_read, 178 178 .llseek = seq_lseek, ··· 185 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 189 .open = progress_open, 190 190 .read = seq_read, 191 191 .llseek = seq_lseek, ··· 198 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 202 .open = clock_open, 203 203 .read = seq_read, 204 204 .llseek = seq_lseek, ··· 211 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 215 .open = tone_freq_open, 216 216 .read = seq_read, 217 217 .llseek = seq_lseek, ··· 224 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 228 .open = tone_volume_open, 229 229 .read = seq_read, 230 230 .llseek = seq_lseek, ··· 237 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 241 .open = rmo_buf_open, 242 242 .read = seq_read, 243 243 .llseek = seq_lseek,
+4 -4
arch/powerpc/kernel/rtas_flash.c
··· 702 702 } 703 703 704 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 707 struct proc_dir_entry *ent = NULL; 708 708 ··· 715 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 719 .read = rtas_flash_read, 720 720 .write = rtas_flash_write, 721 721 .open = rtas_excl_open, 722 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 726 .read = manage_flash_read, 727 727 .write = manage_flash_write, 728 728 .open = rtas_excl_open, 729 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 733 .read = validate_flash_read, 734 734 .write = validate_flash_write, 735 735 .open = rtas_excl_open,
+20 -20
arch/powerpc/platforms/cell/spufs/file.c
··· 144 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 148 .open = spufs_mem_open, 149 149 .read = spufs_mem_read, 150 150 .write = spufs_mem_write, ··· 249 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 253 .open = spufs_cntl_open, 254 254 .release = simple_attr_close, 255 255 .read = simple_attr_read, ··· 309 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 313 .open = spufs_regs_open, 314 314 .read = spufs_regs_read, 315 315 .write = spufs_regs_write, ··· 360 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 364 .open = spufs_regs_open, 365 365 .read = spufs_fpcr_read, 366 366 .write = spufs_fpcr_write, ··· 426 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 430 .open = spufs_pipe_open, 431 431 .read = spufs_mbox_read, 432 432 }; ··· 452 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 456 .open = spufs_pipe_open, 457 457 .read = spufs_mbox_stat_read, 458 458 }; ··· 559 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 563 .open = spufs_pipe_open, 564 564 .read = spufs_ibox_read, 565 565 .poll = spufs_ibox_poll, ··· 585 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 589 .open = spufs_pipe_open, 590 590 .read = spufs_ibox_stat_read, 591 591 }; ··· 692 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 696 .open = spufs_pipe_open, 697 697 .write = spufs_wbox_write, 698 698 .poll = spufs_wbox_poll, ··· 718 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 722 .open = spufs_pipe_open, 723 723 .read = spufs_wbox_stat_read, 724 724 }; ··· 823 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 827 .open = spufs_signal1_open, 828 828 .read = spufs_signal1_read, 829 829 .write = spufs_signal1_write, ··· 934 934 #define spufs_signal2_mmap NULL 935 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 938 .open = spufs_signal2_open, 939 939 .read = spufs_signal2_read, 940 940 .write = spufs_signal2_write, ··· 1037 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 1041 .open = spufs_mss_open, 1042 1042 .mmap = spufs_mss_mmap, 1043 1043 }; ··· 1076 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 1080 .open = spufs_psmap_open, 1081 1081 .mmap = spufs_psmap_mmap, 1082 1082 }; ··· 1393 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 1397 .open = spufs_mfc_open, 1398 1398 .read = spufs_mfc_read, 1399 1399 .write = spufs_mfc_write, ··· 1650 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 1654 .open = spufs_info_open, 1655 1655 .read = spufs_mbox_info_read, 1656 1656 .llseek = generic_file_llseek, ··· 1688 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 1692 .open = spufs_info_open, 1693 1693 .read = spufs_ibox_info_read, 1694 1694 .llseek = generic_file_llseek, ··· 1729 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 1733 .open = spufs_info_open, 1734 1734 .read = spufs_wbox_info_read, 1735 1735 .llseek = generic_file_llseek, ··· 1779 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 1783 .open = spufs_info_open, 1784 1784 .read = spufs_dma_info_read, 1785 1785 }; ··· 1830 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 1834 .open = spufs_info_open, 1835 1835 .read = spufs_proxydma_info_read, 1836 1836 };
+2 -2
arch/powerpc/platforms/cell/spufs/inode.c
··· 224 224 .lookup = simple_lookup, 225 225 }; 226 226 227 - struct file_operations spufs_context_fops = { 227 + const struct file_operations spufs_context_fops = { 228 228 .open = dcache_dir_open, 229 229 .release = spufs_dir_close, 230 230 .llseek = dcache_dir_lseek, ··· 372 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 376 .open = dcache_dir_open, 377 377 .release = spufs_gang_close, 378 378 .llseek = dcache_dir_lseek,
+1 -1
arch/powerpc/platforms/iseries/lpevents.c
··· 308 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 312 .open = proc_lpevents_open, 313 313 .read = seq_read, 314 314 .llseek = seq_lseek,
+1 -1
arch/powerpc/platforms/iseries/mf.c
··· 1224 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 1228 .write = proc_mf_change_vmlinux, 1229 1229 }; 1230 1230
+1 -1
arch/powerpc/platforms/iseries/proc.c
··· 101 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 105 .open = proc_titantod_open, 106 106 .read = seq_read, 107 107 .llseek = seq_lseek,
+1 -1
arch/powerpc/platforms/iseries/viopath.c
··· 173 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 177 .open = proc_viopath_open, 178 178 .read = seq_read, 179 179 .llseek = seq_lseek,
+1 -1
arch/powerpc/platforms/pseries/eeh.c
··· 1078 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 1082 .open = proc_eeh_open, 1083 1083 .read = seq_read, 1084 1084 .llseek = seq_lseek,
+1 -1
arch/powerpc/platforms/pseries/hvCall_inst.c
··· 90 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 94 .open = hcall_inst_seq_open, 95 95 .read = seq_read, 96 96 .llseek = seq_lseek,
+1 -1
arch/powerpc/platforms/pseries/reconfig.c
··· 499 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 503 .write = ofdt_write 504 504 }; 505 505
+1 -1
arch/powerpc/platforms/pseries/rtasd.c
··· 331 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 335 .read = rtas_log_read, 336 336 .poll = rtas_log_poll, 337 337 .open = rtas_log_open,
+1 -1
arch/powerpc/platforms/pseries/scanlog.c
··· 184 184 return 0; 185 185 } 186 186 187 - struct file_operations scanlog_fops = { 187 + const struct file_operations scanlog_fops = { 188 188 .owner = THIS_MODULE, 189 189 .read = scanlog_read, 190 190 .write = scanlog_write,
+3 -3
arch/ppc/8xx_io/cs4218_tdm.c
··· 1711 1711 } 1712 1712 1713 1713 1714 - static struct file_operations mixer_fops = 1714 + static const struct file_operations mixer_fops = 1715 1715 { 1716 1716 .owner = THIS_MODULE, 1717 1717 .llseek = sound_lseek, ··· 2298 2298 2299 2299 2300 2300 2301 - static struct file_operations sq_fops = 2301 + static const struct file_operations sq_fops = 2302 2302 { 2303 2303 .owner = THIS_MODULE, 2304 2304 .llseek = sound_lseek, ··· 2433 2433 } 2434 2434 2435 2435 2436 - static struct file_operations state_fops = 2436 + static const struct file_operations state_fops = 2437 2437 { 2438 2438 .owner = THIS_MODULE, 2439 2439 .llseek = sound_lseek,
+2 -2
arch/s390/hypfs/inode.c
··· 34 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 38 static struct file_system_type hypfs_type; 39 39 static struct super_operations hypfs_s_ops; 40 40 ··· 440 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 444 .open = hypfs_open, 445 445 .release = hypfs_release, 446 446 .read = do_sync_read,
+1 -1
arch/s390/kernel/debug.c
··· 167 167 168 168 static int initialized; 169 169 170 - static struct file_operations debug_file_ops = { 170 + static const struct file_operations debug_file_ops = { 171 171 .owner = THIS_MODULE, 172 172 .read = debug_output, 173 173 .write = debug_input,
+1 -1
arch/sh/boards/landisk/landisk_pwb.c
··· 150 150 return IRQ_HANDLED; 151 151 } 152 152 153 - static struct file_operations swdrv_fops = { 153 + static const struct file_operations swdrv_fops = { 154 154 .read = swdrv_read, /* read */ 155 155 .write = swdrv_write, /* write */ 156 156 .open = swdrv_open, /* open */
+1 -1
arch/sh/mm/cache-debugfs.c
··· 114 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 118 .owner = THIS_MODULE, 119 119 .open = cache_debugfs_open, 120 120 .read = seq_read,
+1 -1
arch/sh/mm/pmb.c
··· 378 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 382 .owner = THIS_MODULE, 383 383 .open = pmb_debugfs_open, 384 384 .read = seq_read,
+1 -1
arch/sh/oprofile/op_model_sh7750.c
··· 187 187 return count; 188 188 } 189 189 190 - static struct file_operations count_fops = { 190 + static const struct file_operations count_fops = { 191 191 .read = sh7750_read_count, 192 192 .write = sh7750_write_count, 193 193 };
+1 -1
arch/sparc/kernel/apc.c
··· 127 127 return 0; 128 128 } 129 129 130 - static struct file_operations apc_fops = { 130 + static const struct file_operations apc_fops = { 131 131 .ioctl = apc_ioctl, 132 132 .open = apc_open, 133 133 .release = apc_release,
+1 -1
arch/sparc64/kernel/time.c
··· 1327 1327 } 1328 1328 1329 1329 1330 - static struct file_operations mini_rtc_fops = { 1330 + static const struct file_operations mini_rtc_fops = { 1331 1331 .owner = THIS_MODULE, 1332 1332 .ioctl = mini_rtc_ioctl, 1333 1333 .open = mini_rtc_open,
+1 -1
arch/sparc64/solaris/socksys.c
··· 163 163 return mask; 164 164 } 165 165 166 - static struct file_operations socksys_fops = { 166 + static const struct file_operations socksys_fops = { 167 167 .open = socksys_open, 168 168 .release = socksys_release, 169 169 };
+1 -1
arch/um/drivers/harddog_kern.c
··· 145 145 } 146 146 } 147 147 148 - static struct file_operations harddog_fops = { 148 + static const struct file_operations harddog_fops = { 149 149 .owner = THIS_MODULE, 150 150 .write = harddog_write, 151 151 .ioctl = harddog_ioctl,
+1 -1
arch/v850/kernel/rte_cb_leds.c
··· 117 117 return 0; 118 118 } 119 119 120 - static struct file_operations leds_fops = { 120 + static const struct file_operations leds_fops = { 121 121 .read = leds_dev_read, 122 122 .write = leds_dev_write, 123 123 .llseek = leds_dev_lseek
+1 -1
arch/x86_64/kernel/mce.c
··· 516 516 } 517 517 } 518 518 519 - static struct file_operations mce_chrdev_ops = { 519 + static const struct file_operations mce_chrdev_ops = { 520 520 .read = mce_read, 521 521 .ioctl = mce_ioctl, 522 522 };