[PATCH] mark struct file_operations const 2
authorArjan van de Ven <arjan@linux.intel.com>
Mon, 12 Feb 2007 08:55:31 +0000 (00:55 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:44 +0000 (09:48 -0800)
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>
59 files changed:
arch/arm/common/rtctime.c
arch/arm/mach-at91rm9200/clock.c
arch/avr32/mm/tlb.c
arch/cris/arch-v10/drivers/ds1302.c
arch/cris/arch-v10/drivers/eeprom.c
arch/cris/arch-v10/drivers/gpio.c
arch/cris/arch-v10/drivers/i2c.c
arch/cris/arch-v10/drivers/pcf8563.c
arch/cris/arch-v32/drivers/cryptocop.c
arch/cris/arch-v32/drivers/gpio.c
arch/cris/arch-v32/drivers/i2c.c
arch/cris/arch-v32/drivers/pcf8563.c
arch/cris/arch-v32/drivers/sync_serial.c
arch/cris/kernel/profile.c
arch/i386/kernel/apm.c
arch/i386/kernel/cpu/mtrr/if.c
arch/i386/kernel/cpuid.c
arch/i386/kernel/microcode.c
arch/i386/kernel/msr.c
arch/ia64/hp/common/sba_iommu.c
arch/ia64/kernel/perfmon.c
arch/ia64/kernel/salinfo.c
arch/ia64/sn/kernel/sn2/sn2_smp.c
arch/ia64/sn/kernel/sn2/sn_hwperf.c
arch/m68k/bvme6000/rtc.c
arch/m68k/mvme16x/rtc.c
arch/mips/kernel/rtlx.c
arch/mips/kernel/vpe.c
arch/mips/sibyte/sb1250/bcm1250_tbprof.c
arch/parisc/kernel/perf.c
arch/powerpc/kernel/lparcfg.c
arch/powerpc/kernel/nvram_64.c
arch/powerpc/kernel/proc_ppc64.c
arch/powerpc/kernel/rtas-proc.c
arch/powerpc/kernel/rtas_flash.c
arch/powerpc/platforms/cell/spufs/file.c
arch/powerpc/platforms/cell/spufs/inode.c
arch/powerpc/platforms/iseries/lpevents.c
arch/powerpc/platforms/iseries/mf.c
arch/powerpc/platforms/iseries/proc.c
arch/powerpc/platforms/iseries/viopath.c
arch/powerpc/platforms/pseries/eeh.c
arch/powerpc/platforms/pseries/hvCall_inst.c
arch/powerpc/platforms/pseries/reconfig.c
arch/powerpc/platforms/pseries/rtasd.c
arch/powerpc/platforms/pseries/scanlog.c
arch/ppc/8xx_io/cs4218_tdm.c
arch/s390/hypfs/inode.c
arch/s390/kernel/debug.c
arch/sh/boards/landisk/landisk_pwb.c
arch/sh/mm/cache-debugfs.c
arch/sh/mm/pmb.c
arch/sh/oprofile/op_model_sh7750.c
arch/sparc/kernel/apc.c
arch/sparc64/kernel/time.c
arch/sparc64/solaris/socksys.c
arch/um/drivers/harddog_kern.c
arch/v850/kernel/rte_cb_leds.c
arch/x86_64/kernel/mce.c

index 4e5445c..bf1075e 100644 (file)
@@ -329,7 +329,7 @@ static int rtc_fasync(int fd, struct file *file, int on)
        return fasync_helper(fd, file, on, &rtc_async_queue);
 }
 
-static struct file_operations rtc_fops = {
+static const struct file_operations rtc_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = rtc_read,
index 4dee21f..36a8e4d 100644 (file)
@@ -407,7 +407,7 @@ static int at91_clk_open(struct inode *inode, struct file *file)
        return single_open(file, at91_clk_show, NULL);
 }
 
-static struct file_operations at91_clk_operations = {
+static const struct file_operations at91_clk_operations = {
        .open           = at91_clk_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 7b07305..5667201 100644 (file)
@@ -360,7 +360,7 @@ static int tlb_open(struct inode *inode, struct file *file)
        return seq_open(file, &tlb_ops);
 }
 
-static struct file_operations proc_tlb_operations = {
+static const struct file_operations proc_tlb_operations = {
        .open           = tlb_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 3cf4f23..88eff7f 100644 (file)
@@ -499,7 +499,7 @@ print_rtc_status(void)
 
 /* The various file operations we support. */
 
-static struct file_operations rtc_fops = {
+static const struct file_operations rtc_fops = {
        .owner =        THIS_MODULE,
        .ioctl =        rtc_ioctl,
 }; 
index 284ebfd..be35a70 100644 (file)
@@ -172,7 +172,7 @@ static const char eeprom_name[] = "eeprom";
 static struct eeprom_type eeprom;
 
 /* This is the exported file-operations structure for this device. */
-struct file_operations eeprom_fops =
+const struct file_operations eeprom_fops =
 {
   .llseek  = eeprom_lseek,
   .read    = eeprom_read,
index 9aba18b..f389ed6 100644 (file)
@@ -838,7 +838,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
        return 0;
 }
 
-struct file_operations gpio_fops = {
+const struct file_operations gpio_fops = {
        .owner       = THIS_MODULE,
        .poll        = gpio_poll,
        .ioctl       = gpio_ioctl,
index 092c724..aca81dd 100644 (file)
@@ -692,7 +692,7 @@ i2c_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
-static struct file_operations i2c_fops = {
+static const struct file_operations i2c_fops = {
        .owner    = THIS_MODULE,
        .ioctl    = i2c_ioctl,
        .open     = i2c_open,
index 8c830ee..107796e 100644 (file)
@@ -56,7 +56,7 @@ static const unsigned char days_in_month[] =
 
 int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
 
-static struct file_operations pcf8563_fops = {
+static const struct file_operations pcf8563_fops = {
        .owner = THIS_MODULE,
        .ioctl = pcf8563_ioctl,
 };
index 2449637..1a071f1 100644 (file)
@@ -266,7 +266,7 @@ static void print_user_dma_lists(struct cryptocop_dma_list_operation *dma_op);
 
 
 
-struct file_operations cryptocop_fops = {
+const struct file_operations cryptocop_fops = {
        owner: THIS_MODULE,
        open: cryptocop_open,
        release: cryptocop_release,
index 08d36f0..d82c5c5 100644 (file)
@@ -705,7 +705,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg)
        return 0;
 }
 
-struct file_operations gpio_fops = {
+const struct file_operations gpio_fops = {
        .owner       = THIS_MODULE,
        .poll        = gpio_poll,
        .ioctl       = gpio_ioctl,
index 95f0018..5d6c527 100644 (file)
@@ -573,7 +573,7 @@ i2c_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
-static struct file_operations i2c_fops = {
+static const struct file_operations i2c_fops = {
        owner:    THIS_MODULE,
        ioctl:    i2c_ioctl,
        open:     i2c_open,
index 2fc7d75..544ab01 100644 (file)
@@ -50,7 +50,7 @@ int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
 int pcf8563_open(struct inode *, struct file *);
 int pcf8563_release(struct inode *, struct file *);
 
-static struct file_operations pcf8563_fops = {
+static const struct file_operations pcf8563_fops = {
        owner: THIS_MODULE,
        ioctl: pcf8563_ioctl,
        open: pcf8563_open,
index 424eb0e..df89298 100644 (file)
@@ -187,7 +187,7 @@ static struct sync_port ports[]=
 
 #define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port))
 
-static struct file_operations sync_serial_fops = {
+static const struct file_operations sync_serial_fops = {
        .owner   = THIS_MODULE,
        .write   = sync_serial_write,
        .read    = sync_serial_read,
index f60ab78..4cfcae6 100644 (file)
@@ -50,7 +50,7 @@ write_cris_profile(struct file *file, const char __user *buf,
   memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE);
 }
 
-static struct file_operations cris_proc_profile_operations = {
+static const struct file_operations cris_proc_profile_operations = {
        .read           = read_cris_profile,
        .write          = write_cris_profile,
 };
index 1990169..db99a89 100644 (file)
@@ -1894,7 +1894,7 @@ static int __init apm_setup(char *str)
 __setup("apm=", apm_setup);
 #endif
 
-static struct file_operations apm_bios_fops = {
+static const struct file_operations apm_bios_fops = {
        .owner          = THIS_MODULE,
        .read           = do_read,
        .poll           = do_poll,
index 5ae1705..ee771f3 100644 (file)
@@ -339,7 +339,7 @@ static int mtrr_open(struct inode *inode, struct file *file)
        return single_open(file, mtrr_seq_show, NULL);
 }
 
-static struct file_operations mtrr_fops = {
+static const struct file_operations mtrr_fops = {
        .owner   = THIS_MODULE,
        .open    = mtrr_open, 
        .read    = seq_read,
index 51130b3..4da75fa 100644 (file)
@@ -148,7 +148,7 @@ static int cpuid_open(struct inode *inode, struct file *file)
 /*
  * File operations we support
  */
-static struct file_operations cpuid_fops = {
+static const struct file_operations cpuid_fops = {
        .owner = THIS_MODULE,
        .llseek = cpuid_seek,
        .read = cpuid_read,
index c8fa137..381252b 100644 (file)
@@ -451,7 +451,7 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_
        return ret;
 }
 
-static struct file_operations microcode_fops = {
+static const struct file_operations microcode_fops = {
        .owner          = THIS_MODULE,
        .write          = microcode_write,
        .open           = microcode_open,
index 4a472a1..4e14264 100644 (file)
@@ -230,7 +230,7 @@ static int msr_open(struct inode *inode, struct file *file)
 /*
  * File operations we support
  */
-static struct file_operations msr_fops = {
+static const struct file_operations msr_fops = {
        .owner = THIS_MODULE,
        .llseek = msr_seek,
        .read = msr_read,
index ce49fe3..c1dca22 100644 (file)
@@ -1881,7 +1881,7 @@ ioc_open(struct inode *inode, struct file *file)
        return seq_open(file, &ioc_seq_ops);
 }
 
-static struct file_operations ioc_fops = {
+static const struct file_operations ioc_fops = {
        .open    = ioc_open,
        .read    = seq_read,
        .llseek  = seq_lseek,
index 86e144f..9860794 100644 (file)
@@ -621,7 +621,7 @@ EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info);
 
 
 /* forward declaration */
-static struct file_operations pfm_file_ops;
+static const struct file_operations pfm_file_ops;
 
 /*
  * forward declarations
@@ -2126,7 +2126,7 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare)
 
 
 
-static struct file_operations pfm_file_ops = {
+static const struct file_operations pfm_file_ops = {
        .llseek   = no_llseek,
        .read     = pfm_read,
        .write    = pfm_write,
@@ -6596,7 +6596,7 @@ found:
        return 0;
 }
 
-static struct file_operations pfm_proc_fops = {
+static const struct file_operations pfm_proc_fops = {
        .open           = pfm_proc_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index e375a2f..af9f875 100644 (file)
@@ -352,7 +352,7 @@ retry:
        return size;
 }
 
-static struct file_operations salinfo_event_fops = {
+static const struct file_operations salinfo_event_fops = {
        .open  = salinfo_event_open,
        .read  = salinfo_event_read,
 };
@@ -568,7 +568,7 @@ salinfo_log_write(struct file *file, const char __user *buffer, size_t count, lo
        return count;
 }
 
-static struct file_operations salinfo_data_fops = {
+static const struct file_operations salinfo_data_fops = {
        .open    = salinfo_log_open,
        .release = salinfo_log_release,
        .read    = salinfo_log_read,
index d9d306c..601747b 100644 (file)
@@ -455,7 +455,7 @@ static int sn2_ptc_proc_open(struct inode *inode, struct file *file)
        return seq_open(file, &sn2_ptc_seq_ops);
 }
 
-static struct file_operations proc_sn2_ptc_operations = {
+static const struct file_operations proc_sn2_ptc_operations = {
        .open = sn2_ptc_proc_open,
        .read = seq_read,
        .llseek = seq_lseek,
index 3336799..6da9854 100644 (file)
@@ -865,7 +865,7 @@ error:
        return r;
 }
 
-static struct file_operations sn_hwperf_fops = {
+static const struct file_operations sn_hwperf_fops = {
        .ioctl = sn_hwperf_ioctl,
 };
 
index 15c16b6..a812d03 100644 (file)
@@ -159,7 +159,7 @@ static int rtc_release(struct inode *inode, struct file *file)
  *     The various file operations we support.
  */
 
-static struct file_operations rtc_fops = {
+static const struct file_operations rtc_fops = {
        .ioctl =        rtc_ioctl,
        .open =         rtc_open,
        .release =      rtc_release,
index b0e4c08..272d47e 100644 (file)
@@ -147,7 +147,7 @@ static int rtc_release(struct inode *inode, struct file *file)
  *     The various file operations we support.
  */
 
-static struct file_operations rtc_fops = {
+static const struct file_operations rtc_fops = {
        .ioctl =        rtc_ioctl,
        .open =         rtc_open,
        .release =      rtc_release,
index f29e93c..d92c48e 100644 (file)
@@ -478,7 +478,7 @@ static ssize_t file_write(struct file *file, const char __user * buffer,
        return rtlx_write(minor, (void *)buffer, count, 1);
 }
 
-static struct file_operations rtlx_fops = {
+static const struct file_operations rtlx_fops = {
        .owner =   THIS_MODULE,
        .open =    file_open,
        .release = file_release,
index 4e832da..9aca871 100644 (file)
@@ -1208,7 +1208,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer,
        return ret;
 }
 
-static struct file_operations vpe_fops = {
+static const struct file_operations vpe_fops = {
        .owner = THIS_MODULE,
        .open = vpe_open,
        .release = vpe_release,
index d1a906e..212547c 100644 (file)
@@ -374,7 +374,7 @@ static long sbprof_tb_ioctl(struct file *filp,
        return error;
 }
 
-static struct file_operations sbprof_tb_fops = {
+static const struct file_operations sbprof_tb_fops = {
        .owner          = THIS_MODULE,
        .open           = sbprof_tb_open,
        .release        = sbprof_tb_release,
index ac8ee20..a46bc62 100644 (file)
@@ -479,7 +479,7 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        return error;
 }
 
-static struct file_operations perf_fops = {
+static const struct file_operations perf_fops = {
        .llseek = no_llseek,
        .read = perf_read,
        .write = perf_write,
index 0de5a08..89486b6 100644 (file)
@@ -571,7 +571,7 @@ static int lparcfg_open(struct inode *inode, struct file *file)
        return single_open(file, lparcfg_data, NULL);
 }
 
-struct file_operations lparcfg_fops = {
+const struct file_operations lparcfg_fops = {
        .owner          = THIS_MODULE,
        .read           = seq_read,
        .write          = lparcfg_write,
index 869cebb..f9676f5 100644 (file)
@@ -179,7 +179,7 @@ static int dev_nvram_ioctl(struct inode *inode, struct file *file,
        }
 }
 
-struct file_operations nvram_fops = {
+const struct file_operations nvram_fops = {
        .owner =        THIS_MODULE,
        .llseek =       dev_nvram_llseek,
        .read =         dev_nvram_read,
index 3d437c3..f78dfce 100644 (file)
@@ -33,7 +33,7 @@ static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes
                              loff_t *ppos);
 static int     page_map_mmap( struct file *file, struct vm_area_struct *vma );
 
-static struct file_operations page_map_fops = {
+static const struct file_operations page_map_fops = {
        .llseek = page_map_seek,
        .read   = page_map_read,
        .mmap   = page_map_mmap
index 2fe82ab..6cbf2ae 100644 (file)
@@ -160,7 +160,7 @@ static int sensors_open(struct inode *inode, struct file *file)
        return single_open(file, ppc_rtas_sensors_show, NULL);
 }
 
-struct file_operations ppc_rtas_sensors_operations = {
+const struct file_operations ppc_rtas_sensors_operations = {
        .open           = sensors_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -172,7 +172,7 @@ static int poweron_open(struct inode *inode, struct file *file)
        return single_open(file, ppc_rtas_poweron_show, NULL);
 }
 
-struct file_operations ppc_rtas_poweron_operations = {
+const struct file_operations ppc_rtas_poweron_operations = {
        .open           = poweron_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -185,7 +185,7 @@ static int progress_open(struct inode *inode, struct file *file)
        return single_open(file, ppc_rtas_progress_show, NULL);
 }
 
-struct file_operations ppc_rtas_progress_operations = {
+const struct file_operations ppc_rtas_progress_operations = {
        .open           = progress_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -198,7 +198,7 @@ static int clock_open(struct inode *inode, struct file *file)
        return single_open(file, ppc_rtas_clock_show, NULL);
 }
 
-struct file_operations ppc_rtas_clock_operations = {
+const struct file_operations ppc_rtas_clock_operations = {
        .open           = clock_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -211,7 +211,7 @@ static int tone_freq_open(struct inode *inode, struct file *file)
        return single_open(file, ppc_rtas_tone_freq_show, NULL);
 }
 
-struct file_operations ppc_rtas_tone_freq_operations = {
+const struct file_operations ppc_rtas_tone_freq_operations = {
        .open           = tone_freq_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -224,7 +224,7 @@ static int tone_volume_open(struct inode *inode, struct file *file)
        return single_open(file, ppc_rtas_tone_volume_show, NULL);
 }
 
-struct file_operations ppc_rtas_tone_volume_operations = {
+const struct file_operations ppc_rtas_tone_volume_operations = {
        .open           = tone_volume_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
@@ -237,7 +237,7 @@ static int rmo_buf_open(struct inode *inode, struct file *file)
        return single_open(file, ppc_rtas_rmo_buf_show, NULL);
 }
 
-struct file_operations ppc_rtas_rmo_buf_ops = {
+const struct file_operations ppc_rtas_rmo_buf_ops = {
        .open           = rmo_buf_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 65e4ebe..f72118c 100644 (file)
@@ -702,7 +702,7 @@ static int initialize_flash_pde_data(const char *rtas_call_name,
 }
 
 static struct proc_dir_entry *create_flash_pde(const char *filename,
-                                              struct file_operations *fops)
+                                              const struct file_operations *fops)
 {
        struct proc_dir_entry *ent = NULL;
 
@@ -715,21 +715,21 @@ static struct proc_dir_entry *create_flash_pde(const char *filename,
        return ent;
 }
 
-static struct file_operations rtas_flash_operations = {
+static const struct file_operations rtas_flash_operations = {
        .read           = rtas_flash_read,
        .write          = rtas_flash_write,
        .open           = rtas_excl_open,
        .release        = rtas_flash_release,
 };
 
-static struct file_operations manage_flash_operations = {
+static const struct file_operations manage_flash_operations = {
        .read           = manage_flash_read,
        .write          = manage_flash_write,
        .open           = rtas_excl_open,
        .release        = rtas_excl_release,
 };
 
-static struct file_operations validate_flash_operations = {
+static const struct file_operations validate_flash_operations = {
        .read           = validate_flash_read,
        .write          = validate_flash_write,
        .open           = rtas_excl_open,
index 347eff5..af9e945 100644 (file)
@@ -144,7 +144,7 @@ spufs_mem_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static struct file_operations spufs_mem_fops = {
+static const struct file_operations spufs_mem_fops = {
        .open    = spufs_mem_open,
        .read    = spufs_mem_read,
        .write   = spufs_mem_write,
@@ -249,7 +249,7 @@ static int spufs_cntl_open(struct inode *inode, struct file *file)
                                        spufs_cntl_set, "0x%08lx");
 }
 
-static struct file_operations spufs_cntl_fops = {
+static const struct file_operations spufs_cntl_fops = {
        .open = spufs_cntl_open,
        .release = simple_attr_close,
        .read = simple_attr_read,
@@ -309,7 +309,7 @@ spufs_regs_write(struct file *file, const char __user *buffer,
        return ret;
 }
 
-static struct file_operations spufs_regs_fops = {
+static const struct file_operations spufs_regs_fops = {
        .open    = spufs_regs_open,
        .read    = spufs_regs_read,
        .write   = spufs_regs_write,
@@ -360,7 +360,7 @@ spufs_fpcr_write(struct file *file, const char __user * buffer,
        return ret;
 }
 
-static struct file_operations spufs_fpcr_fops = {
+static const struct file_operations spufs_fpcr_fops = {
        .open = spufs_regs_open,
        .read = spufs_fpcr_read,
        .write = spufs_fpcr_write,
@@ -426,7 +426,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf,
        return count;
 }
 
-static struct file_operations spufs_mbox_fops = {
+static const struct file_operations spufs_mbox_fops = {
        .open   = spufs_pipe_open,
        .read   = spufs_mbox_read,
 };
@@ -452,7 +452,7 @@ static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf,
        return 4;
 }
 
-static struct file_operations spufs_mbox_stat_fops = {
+static const struct file_operations spufs_mbox_stat_fops = {
        .open   = spufs_pipe_open,
        .read   = spufs_mbox_stat_read,
 };
@@ -559,7 +559,7 @@ static unsigned int spufs_ibox_poll(struct file *file, poll_table *wait)
        return mask;
 }
 
-static struct file_operations spufs_ibox_fops = {
+static const struct file_operations spufs_ibox_fops = {
        .open   = spufs_pipe_open,
        .read   = spufs_ibox_read,
        .poll   = spufs_ibox_poll,
@@ -585,7 +585,7 @@ static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf,
        return 4;
 }
 
-static struct file_operations spufs_ibox_stat_fops = {
+static const struct file_operations spufs_ibox_stat_fops = {
        .open   = spufs_pipe_open,
        .read   = spufs_ibox_stat_read,
 };
@@ -692,7 +692,7 @@ static unsigned int spufs_wbox_poll(struct file *file, poll_table *wait)
        return mask;
 }
 
-static struct file_operations spufs_wbox_fops = {
+static const struct file_operations spufs_wbox_fops = {
        .open   = spufs_pipe_open,
        .write  = spufs_wbox_write,
        .poll   = spufs_wbox_poll,
@@ -718,7 +718,7 @@ static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf,
        return 4;
 }
 
-static struct file_operations spufs_wbox_stat_fops = {
+static const struct file_operations spufs_wbox_stat_fops = {
        .open   = spufs_pipe_open,
        .read   = spufs_wbox_stat_read,
 };
@@ -823,7 +823,7 @@ static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static struct file_operations spufs_signal1_fops = {
+static const struct file_operations spufs_signal1_fops = {
        .open = spufs_signal1_open,
        .read = spufs_signal1_read,
        .write = spufs_signal1_write,
@@ -934,7 +934,7 @@ static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma)
 #define spufs_signal2_mmap NULL
 #endif /* !SPUFS_MMAP_4K */
 
-static struct file_operations spufs_signal2_fops = {
+static const struct file_operations spufs_signal2_fops = {
        .open = spufs_signal2_open,
        .read = spufs_signal2_read,
        .write = spufs_signal2_write,
@@ -1037,7 +1037,7 @@ static int spufs_mss_open(struct inode *inode, struct file *file)
        return nonseekable_open(inode, file);
 }
 
-static struct file_operations spufs_mss_fops = {
+static const struct file_operations spufs_mss_fops = {
        .open    = spufs_mss_open,
        .mmap    = spufs_mss_mmap,
 };
@@ -1076,7 +1076,7 @@ static int spufs_psmap_open(struct inode *inode, struct file *file)
        return nonseekable_open(inode, file);
 }
 
-static struct file_operations spufs_psmap_fops = {
+static const struct file_operations spufs_psmap_fops = {
        .open    = spufs_psmap_open,
        .mmap    = spufs_psmap_mmap,
 };
@@ -1393,7 +1393,7 @@ static int spufs_mfc_fasync(int fd, struct file *file, int on)
        return fasync_helper(fd, file, on, &ctx->mfc_fasync);
 }
 
-static struct file_operations spufs_mfc_fops = {
+static const struct file_operations spufs_mfc_fops = {
        .open    = spufs_mfc_open,
        .read    = spufs_mfc_read,
        .write   = spufs_mfc_write,
@@ -1650,7 +1650,7 @@ static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf,
        return ret;
 }
 
-static struct file_operations spufs_mbox_info_fops = {
+static const struct file_operations spufs_mbox_info_fops = {
        .open = spufs_info_open,
        .read = spufs_mbox_info_read,
        .llseek  = generic_file_llseek,
@@ -1688,7 +1688,7 @@ static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf,
        return ret;
 }
 
-static struct file_operations spufs_ibox_info_fops = {
+static const struct file_operations spufs_ibox_info_fops = {
        .open = spufs_info_open,
        .read = spufs_ibox_info_read,
        .llseek  = generic_file_llseek,
@@ -1729,7 +1729,7 @@ static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf,
        return ret;
 }
 
-static struct file_operations spufs_wbox_info_fops = {
+static const struct file_operations spufs_wbox_info_fops = {
        .open = spufs_info_open,
        .read = spufs_wbox_info_read,
        .llseek  = generic_file_llseek,
@@ -1779,7 +1779,7 @@ static ssize_t spufs_dma_info_read(struct file *file, char __user *buf,
        return ret;
 }
 
-static struct file_operations spufs_dma_info_fops = {
+static const struct file_operations spufs_dma_info_fops = {
        .open = spufs_info_open,
        .read = spufs_dma_info_read,
 };
@@ -1830,7 +1830,7 @@ static ssize_t spufs_proxydma_info_read(struct file *file, char __user *buf,
        return ret;
 }
 
-static struct file_operations spufs_proxydma_info_fops = {
+static const struct file_operations spufs_proxydma_info_fops = {
        .open = spufs_info_open,
        .read = spufs_proxydma_info_read,
 };
index 738b924..bffc934 100644 (file)
@@ -224,7 +224,7 @@ struct inode_operations spufs_dir_inode_operations = {
        .lookup = simple_lookup,
 };
 
-struct file_operations spufs_context_fops = {
+const struct file_operations spufs_context_fops = {
        .open           = dcache_dir_open,
        .release        = spufs_dir_close,
        .llseek         = dcache_dir_lseek,
@@ -372,7 +372,7 @@ static int spufs_gang_close(struct inode *inode, struct file *file)
        return dcache_dir_close(inode, file);
 }
 
-struct file_operations spufs_gang_fops = {
+const struct file_operations spufs_gang_fops = {
        .open           = dcache_dir_open,
        .release        = spufs_gang_close,
        .llseek         = dcache_dir_lseek,
index c1f4502..91df52a 100644 (file)
@@ -308,7 +308,7 @@ static int proc_lpevents_open(struct inode *inode, struct file *file)
        return single_open(file, proc_lpevents_show, NULL);
 }
 
-static struct file_operations proc_lpevents_operations = {
+static const struct file_operations proc_lpevents_operations = {
        .open           = proc_lpevents_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 90d3d49..b1187d9 100644 (file)
@@ -1224,7 +1224,7 @@ out:
        return rc;
 }
 
-static struct file_operations proc_vmlinux_operations = {
+static const struct file_operations proc_vmlinux_operations = {
        .write          = proc_mf_change_vmlinux,
 };
 
index b54e371..f2cde41 100644 (file)
@@ -101,7 +101,7 @@ static int proc_titantod_open(struct inode *inode, struct file *file)
        return single_open(file, proc_titantod_show, NULL);
 }
 
-static struct file_operations proc_titantod_operations = {
+static const struct file_operations proc_titantod_operations = {
        .open           = proc_titantod_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index a6799ed..e2100ec 100644 (file)
@@ -173,7 +173,7 @@ static int proc_viopath_open(struct inode *inode, struct file *file)
        return single_open(file, proc_viopath_show, NULL);
 }
 
-static struct file_operations proc_viopath_operations = {
+static const struct file_operations proc_viopath_operations = {
        .open           = proc_viopath_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
index 9437f48..6cedbc0 100644 (file)
@@ -1078,7 +1078,7 @@ static int proc_eeh_open(struct inode *inode, struct file *file)
        return single_open(file, proc_eeh_show, NULL);
 }
 
-static struct file_operations proc_eeh_operations = {
+static const struct file_operations proc_eeh_operations = {
        .open      = proc_eeh_open,
        .read      = seq_read,
        .llseek    = seq_lseek,
index 3ddc049..eae51ef 100644 (file)
@@ -90,7 +90,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file)
        return rc;
 }
 
-static struct file_operations hcall_inst_seq_fops = {
+static const struct file_operations hcall_inst_seq_fops = {
        .open = hcall_inst_seq_open,
        .read = seq_read,
        .llseek = seq_lseek,
index 789a5e9..5aa97af 100644 (file)
@@ -499,7 +499,7 @@ out:
        return rv ? rv : count;
 }
 
-static struct file_operations ofdt_fops = {
+static const struct file_operations ofdt_fops = {
        .write = ofdt_write
 };
 
index 8ca2612..77d0937 100644 (file)
@@ -331,7 +331,7 @@ static unsigned int rtas_log_poll(struct file *file, poll_table * wait)
        return 0;
 }
 
-struct file_operations proc_rtas_log_operations = {
+const struct file_operations proc_rtas_log_operations = {
        .read =         rtas_log_read,
        .poll =         rtas_log_poll,
        .open =         rtas_log_open,
index 45368a5..8e1ef16 100644 (file)
@@ -184,7 +184,7 @@ static int scanlog_release(struct inode * inode, struct file * file)
        return 0;
 }
 
-struct file_operations scanlog_fops = {
+const struct file_operations scanlog_fops = {
        .owner          = THIS_MODULE,
        .read           = scanlog_read,
        .write          = scanlog_write,
index 684ed04..a956f28 100644 (file)
@@ -1711,7 +1711,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
 }
 
 
-static struct file_operations mixer_fops =
+static const struct file_operations mixer_fops =
 {
        .owner =        THIS_MODULE,
        .llseek =       sound_lseek,
@@ -2298,7 +2298,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
 
 
 
-static struct file_operations sq_fops =
+static const struct file_operations sq_fops =
 {
        .owner =        THIS_MODULE,
        .llseek =       sound_lseek,
@@ -2433,7 +2433,7 @@ static ssize_t state_read(struct file *file, char *buf, size_t count,
 }
 
 
-static struct file_operations state_fops =
+static const struct file_operations state_fops =
 {
        .owner =        THIS_MODULE,
        .llseek =       sound_lseek,
index a4fda7b..ba5d316 100644 (file)
@@ -34,7 +34,7 @@ struct hypfs_sb_info {
        struct mutex lock;              /* lock to protect update process */
 };
 
-static struct file_operations hypfs_file_ops;
+static const struct file_operations hypfs_file_ops;
 static struct file_system_type hypfs_type;
 static struct super_operations hypfs_s_ops;
 
@@ -440,7 +440,7 @@ struct dentry *hypfs_create_str(struct super_block *sb, struct dentry *dir,
        return dentry;
 }
 
-static struct file_operations hypfs_file_ops = {
+static const struct file_operations hypfs_file_ops = {
        .open           = hypfs_open,
        .release        = hypfs_release,
        .read           = do_sync_read,
index f4b62df..51653d8 100644 (file)
@@ -167,7 +167,7 @@ static DECLARE_MUTEX(debug_lock);
 
 static int initialized;
 
-static struct file_operations debug_file_ops = {
+static const struct file_operations debug_file_ops = {
        .owner   = THIS_MODULE,
        .read    = debug_output,
        .write   = debug_input,
index e625249..47a63c6 100644 (file)
@@ -150,7 +150,7 @@ static irqreturn_t sw_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static struct file_operations swdrv_fops = {
+static const struct file_operations swdrv_fops = {
        .read = swdrv_read,     /* read */
        .write = swdrv_write,   /* write */
        .open = swdrv_open,     /* open */
index e0122bd..909dcfa 100644 (file)
@@ -114,7 +114,7 @@ static int cache_debugfs_open(struct inode *inode, struct file *file)
        return single_open(file, cache_seq_show, inode->i_private);
 }
 
-static struct file_operations cache_debugfs_fops = {
+static const struct file_operations cache_debugfs_fops = {
        .owner          = THIS_MODULE,
        .open           = cache_debugfs_open,
        .read           = seq_read,
index b60ad83..d0d45e2 100644 (file)
@@ -378,7 +378,7 @@ static int pmb_debugfs_open(struct inode *inode, struct file *file)
        return single_open(file, pmb_seq_show, NULL);
 }
 
-static struct file_operations pmb_debugfs_fops = {
+static const struct file_operations pmb_debugfs_fops = {
        .owner          = THIS_MODULE,
        .open           = pmb_debugfs_open,
        .read           = seq_read,
index 60402ee..0104e44 100644 (file)
@@ -187,7 +187,7 @@ static ssize_t sh7750_write_count(struct file *file, const char __user *buf,
        return count;
 }
 
-static struct file_operations count_fops = {
+static const struct file_operations count_fops = {
        .read           = sh7750_read_count,
        .write          = sh7750_write_count,
 };
index 406dd94..d06a405 100644 (file)
@@ -127,7 +127,7 @@ static int apc_ioctl(struct inode *inode, struct file *f,
        return 0;
 }
 
-static struct file_operations apc_fops = {
+static const struct file_operations apc_fops = {
        .ioctl =        apc_ioctl,
        .open =         apc_open,
        .release =      apc_release,
index 061e1b1..f84da4f 100644 (file)
@@ -1327,7 +1327,7 @@ static int mini_rtc_release(struct inode *inode, struct file *file)
 }
 
 
-static struct file_operations mini_rtc_fops = {
+static const struct file_operations mini_rtc_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = mini_rtc_ioctl,
        .open           = mini_rtc_open,
index 89a4757..c286444 100644 (file)
@@ -163,7 +163,7 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait)
        return mask;
 }
        
-static struct file_operations socksys_fops = {
+static const struct file_operations socksys_fops = {
        .open =         socksys_open,
        .release =      socksys_release,
 };
index 73c5caa..5560168 100644 (file)
@@ -145,7 +145,7 @@ static int harddog_ioctl(struct inode *inode, struct file *file,
        }
 }
 
-static struct file_operations harddog_fops = {
+static const struct file_operations harddog_fops = {
        .owner          = THIS_MODULE,
        .write          = harddog_write,
        .ioctl          = harddog_ioctl,
index 996bd4f..aa47ab1 100644 (file)
@@ -117,7 +117,7 @@ static loff_t leds_dev_lseek (struct file *file, loff_t offs, int whence)
        return 0;
 }
 
-static struct file_operations leds_fops = {
+static const struct file_operations leds_fops = {
        .read           = leds_dev_read,
        .write          = leds_dev_write,
        .llseek         = leds_dev_lseek
index ac08503..bdb54a2 100644 (file)
@@ -516,7 +516,7 @@ static int mce_ioctl(struct inode *i, struct file *f,unsigned int cmd, unsigned
        } 
 }
 
-static struct file_operations mce_chrdev_ops = {
+static const struct file_operations mce_chrdev_ops = {
        .read = mce_read,
        .ioctl = mce_ioctl,
 };