[PATCH] mark struct file_operations const 4
authorArjan van de Ven <arjan@linux.intel.com>
Mon, 12 Feb 2007 08:55:33 +0000 (00:55 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:45 +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@sdl.org: dvb 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>
67 files changed:
drivers/macintosh/adb.c
drivers/macintosh/ans-lcd.c
drivers/macintosh/apm_emu.c
drivers/macintosh/nvram.c
drivers/macintosh/smu.c
drivers/macintosh/via-pmu.c
drivers/macintosh/via-pmu68k.c
drivers/md/dm-ioctl.c
drivers/md/md.c
drivers/media/common/saa7146_fops.c
drivers/media/radio/dsbr100.c
drivers/media/radio/miropcm20-radio.c
drivers/media/radio/miropcm20-rds.c
drivers/media/radio/radio-aimslab.c
drivers/media/radio/radio-aztech.c
drivers/media/radio/radio-cadet.c
drivers/media/radio/radio-gemtek-pci.c
drivers/media/radio/radio-gemtek.c
drivers/media/radio/radio-maestro.c
drivers/media/radio/radio-maxiradio.c
drivers/media/radio/radio-rtrack2.c
drivers/media/radio/radio-sf16fmi.c
drivers/media/radio/radio-sf16fmr2.c
drivers/media/radio/radio-terratec.c
drivers/media/radio/radio-trust.c
drivers/media/radio/radio-typhoon.c
drivers/media/radio/radio-zoltrix.c
drivers/media/video/arv.c
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/bw-qcam.c
drivers/media/video/c-qcam.c
drivers/media/video/cafe_ccic.c
drivers/media/video/cpia.c
drivers/media/video/cpia2/cpia2_v4l.c
drivers/media/video/cx88/cx88-blackbird.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/dabusb.c
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/meye.c
drivers/media/video/ov511.c
drivers/media/video/pms.c
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/saa5246a.c
drivers/media/video/saa5249.c
drivers/media/video/saa7134/saa7134-empress.c
drivers/media/video/saa7134/saa7134-oss.c
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/saa7134/saa7134.h
drivers/media/video/se401.c
drivers/media/video/sn9c102/sn9c102_core.c
drivers/media/video/stradis.c
drivers/media/video/stv680.c
drivers/media/video/tvmixer.c
drivers/media/video/usbvideo/usbvideo.c
drivers/media/video/usbvideo/vicam.c
drivers/media/video/usbvision/usbvision-video.c
drivers/media/video/videodev.c
drivers/media/video/vino.c
drivers/media/video/vivi.c
drivers/media/video/w9966.c
drivers/media/video/w9968cf.c
drivers/media/video/zc0301/zc0301_core.c
drivers/media/video/zoran_driver.c
drivers/media/video/zoran_procfs.c
drivers/message/fusion/mptctl.c

index 7cec6de..f729eeb 100644 (file)
@@ -885,7 +885,7 @@ out:
        return ret;
 }
 
-static struct file_operations adb_fops = {
+static const struct file_operations adb_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = adb_read,
index 2b8a6e8..cdd5a0f 100644 (file)
@@ -121,7 +121,7 @@ anslcd_open( struct inode * inode, struct file * file )
        return 0;
 }
 
-struct file_operations anslcd_fops = {
+const struct file_operations anslcd_fops = {
        .write  = anslcd_write,
        .ioctl  = anslcd_ioctl,
        .open   = anslcd_open,
index 4300c62..a6d50f4 100644 (file)
@@ -501,7 +501,7 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
        return p - buf;
 }
 
-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 3079187..b195d75 100644 (file)
@@ -100,7 +100,7 @@ static int nvram_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
-struct file_operations nvram_fops = {
+const struct file_operations nvram_fops = {
        .owner          = THIS_MODULE,
        .llseek         = nvram_llseek,
        .read           = read_nvram,
index 6f30459..3096836 100644 (file)
@@ -1277,7 +1277,7 @@ static int smu_release(struct inode *inode, struct file *file)
 }
 
 
-static struct file_operations smu_device_fops = {
+static const struct file_operations smu_device_fops = {
        .llseek         = no_llseek,
        .read           = smu_read,
        .write          = smu_write,
index eb6653f..96bea4b 100644 (file)
@@ -2672,7 +2672,7 @@ pmu_ioctl(struct inode * inode, struct file *filp,
        return error;
 }
 
-static struct file_operations pmu_device_fops = {
+static const struct file_operations pmu_device_fops = {
        .read           = pmu_read,
        .write          = pmu_write,
        .poll           = pmu_fpoll,
index 93e6ef9..4f5b6fa 100644 (file)
@@ -1040,7 +1040,7 @@ static int pmu_ioctl(struct inode * inode, struct file *filp,
        return -EINVAL;
 }
 
-static struct file_operations pmu_device_fops = {
+static const struct file_operations pmu_device_fops = {
        .read           = pmu_read,
        .write          = pmu_write,
        .ioctl          = pmu_ioctl,
index cd6a184..b441d82 100644 (file)
@@ -1473,7 +1473,7 @@ static int ctl_ioctl(struct inode *inode, struct file *file,
        return r;
 }
 
-static struct file_operations _ctl_fops = {
+static const struct file_operations _ctl_fops = {
        .ioctl   = ctl_ioctl,
        .owner   = THIS_MODULE,
 };
index e8807ea..e85fa75 100644 (file)
@@ -4920,7 +4920,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
        return mask;
 }
 
-static struct file_operations md_seq_fops = {
+static const struct file_operations md_seq_fops = {
        .owner          = THIS_MODULE,
        .open           = md_seq_open,
        .read           = seq_read,
index d867a6a..b8dcfa1 100644 (file)
@@ -416,7 +416,7 @@ static ssize_t fops_write(struct file *file, const char __user *data, size_t cou
        }
 }
 
-static struct file_operations video_fops =
+static const struct file_operations video_fops =
 {
        .owner          = THIS_MODULE,
        .open           = fops_open,
index db865a0..df8d052 100644 (file)
@@ -144,7 +144,7 @@ struct dsbr100_device {
 
 
 /* File system interface */
-static struct file_operations usb_dsbr100_fops = {
+static const struct file_operations usb_dsbr100_fops = {
        .owner =        THIS_MODULE,
        .open =         usb_dsbr100_open,
        .release =      usb_dsbr100_close,
index c4312fa..c7c9d1d 100644 (file)
@@ -216,7 +216,7 @@ static struct pcm20_device pcm20_unit = {
        .muted  = 1,
 };
 
-static struct file_operations pcm20_fops = {
+static const struct file_operations pcm20_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index c1b1db6..c93490e 100644 (file)
@@ -105,7 +105,7 @@ static ssize_t rds_f_read(struct file *file, char __user *buffer, size_t length,
        }
 }
 
-static struct file_operations rds_fops = {
+static const struct file_operations rds_fops = {
        .owner          = THIS_MODULE,
        .read           = rds_f_read,
        .open           = rds_f_open,
index 3368a89..b2e88ad 100644 (file)
@@ -358,7 +358,7 @@ static int rt_ioctl(struct inode *inode, struct file *file,
 
 static struct rt_device rtrack_unit;
 
-static struct file_operations rtrack_fops = {
+static const struct file_operations rtrack_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index 3ba5fa8..19d45cc 100644 (file)
@@ -314,7 +314,7 @@ static int az_ioctl(struct inode *inode, struct file *file,
 
 static struct az_device aztech_unit;
 
-static struct file_operations aztech_fops = {
+static const struct file_operations aztech_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index 69d4b79..8fbf0d8 100644 (file)
@@ -507,7 +507,7 @@ cadet_poll(struct file *file, struct poll_table_struct *wait)
 }
 
 
-static struct file_operations cadet_fops = {
+static const struct file_operations cadet_fops = {
        .owner          = THIS_MODULE,
        .open           = cadet_open,
        .release        = cadet_release,
index eb14106..05e5aa7 100644 (file)
@@ -346,7 +346,7 @@ MODULE_DEVICE_TABLE( pci, gemtek_pci_id );
 
 static int mx = 1;
 
-static struct file_operations gemtek_pci_fops = {
+static const struct file_operations gemtek_pci_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index 730fe16..36c4be6 100644 (file)
@@ -296,7 +296,7 @@ static int gemtek_ioctl(struct inode *inode, struct file *file,
 
 static struct gemtek_device gemtek_unit;
 
-static struct file_operations gemtek_fops = {
+static const struct file_operations gemtek_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index e8ce5f7..9bba6eb 100644 (file)
@@ -99,7 +99,7 @@ static struct pci_driver maestro_r_driver = {
        .remove         = __devexit_p(maestro_remove),
 };
 
-static struct file_operations maestro_fops = {
+static const struct file_operations maestro_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index c2eeae7..00a2f31 100644 (file)
@@ -91,7 +91,7 @@ module_param(radio_nr, int, 0);
 static int radio_ioctl(struct inode *inode, struct file *file,
                       unsigned int cmd, unsigned long arg);
 
-static struct file_operations maxiradio_fops = {
+static const struct file_operations maxiradio_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index b9e9848..f668387 100644 (file)
@@ -262,7 +262,7 @@ static int rt_ioctl(struct inode *inode, struct file *file,
 
 static struct rt_device rtrack2_unit;
 
-static struct file_operations rtrack2_fops = {
+static const struct file_operations rtrack2_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index ecc854b..f4619e4 100644 (file)
@@ -265,7 +265,7 @@ static int fmi_ioctl(struct inode *inode, struct file *file,
 
 static struct fmi_device fmi_unit;
 
-static struct file_operations fmi_fops = {
+static const struct file_operations fmi_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index 4444dce..b96fafe 100644 (file)
@@ -410,7 +410,7 @@ static int fmr2_ioctl(struct inode *inode, struct file *file,
 
 static struct fmr2_device fmr2_unit;
 
-static struct file_operations fmr2_fops = {
+static const struct file_operations fmr2_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index f539491..d59a27a 100644 (file)
@@ -338,7 +338,7 @@ static int tt_ioctl(struct inode *inode, struct file *file,
 
 static struct tt_device terratec_unit;
 
-static struct file_operations terratec_fops = {
+static const struct file_operations terratec_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index bb03ad5..6d7f1e7 100644 (file)
@@ -325,7 +325,7 @@ static int tr_ioctl(struct inode *inode, struct file *file,
        return video_usercopy(inode, file, cmd, arg, tr_do_ioctl);
 }
 
-static struct file_operations trust_fops = {
+static const struct file_operations trust_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index 4a72b4d..3031fef 100644 (file)
@@ -318,7 +318,7 @@ static struct typhoon_device typhoon_unit =
        .mutefreq       = CONFIG_RADIO_TYPHOON_MUTEFREQ,
 };
 
-static struct file_operations typhoon_fops = {
+static const struct file_operations typhoon_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index 671fe1b..ec08491 100644 (file)
@@ -373,7 +373,7 @@ static int zol_ioctl(struct inode *inode, struct file *file,
 
 static struct zol_device zoltrix_unit;
 
-static struct file_operations zoltrix_fops =
+static const struct file_operations zoltrix_fops =
 {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
index 4861799..649f52f 100644 (file)
@@ -742,7 +742,7 @@ void ar_release(struct video_device *vfd)
  * Video4Linux Module functions
  *
  ****************************************************************************/
-static struct file_operations ar_fops = {
+static const struct file_operations ar_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index ab8f970..41fd09d 100644 (file)
@@ -3174,7 +3174,7 @@ bttv_mmap(struct file *file, struct vm_area_struct *vma)
        return videobuf_mmap_mapper(bttv_queue(fh),vma);
 }
 
-static struct file_operations bttv_fops =
+static const struct file_operations bttv_fops =
 {
        .owner    = THIS_MODULE,
        .open     = bttv_open,
@@ -3332,7 +3332,7 @@ static unsigned int radio_poll(struct file *file, poll_table *wait)
        return cmd.result;
 }
 
-static struct file_operations radio_fops =
+static const struct file_operations radio_fops =
 {
        .owner    = THIS_MODULE,
        .open     = radio_open,
index 7d0b6e5..7d47cbe 100644 (file)
@@ -871,7 +871,7 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
        return len;
 }
 
-static struct file_operations qcam_fops = {
+static const struct file_operations qcam_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index a3989bd..925ff17 100644 (file)
@@ -684,7 +684,7 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
 }
 
 /* video device template */
-static struct file_operations qcam_fops = {
+static const struct file_operations qcam_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index 3083c80..fb1410c 100644 (file)
@@ -1715,7 +1715,7 @@ static void cafe_v4l_dev_release(struct video_device *vd)
  * clone it for specific real devices.
  */
 
-static struct file_operations cafe_v4l_fops = {
+static const struct file_operations cafe_v4l_fops = {
        .owner = THIS_MODULE,
        .open = cafe_v4l_open,
        .release = cafe_v4l_release,
@@ -1969,7 +1969,7 @@ static ssize_t cafe_dfs_read_regs(struct file *file,
                        s - cafe_debug_buf);
 }
 
-static struct file_operations cafe_dfs_reg_ops = {
+static const struct file_operations cafe_dfs_reg_ops = {
        .owner = THIS_MODULE,
        .read = cafe_dfs_read_regs,
        .open = cafe_dfs_open
@@ -1995,7 +1995,7 @@ static ssize_t cafe_dfs_read_cam(struct file *file,
                        s - cafe_debug_buf);
 }
 
-static struct file_operations cafe_dfs_cam_ops = {
+static const struct file_operations cafe_dfs_cam_ops = {
        .owner = THIS_MODULE,
        .read = cafe_dfs_read_cam,
        .open = cafe_dfs_open
index 3b31a0d..7e8d5ef 100644 (file)
@@ -3791,7 +3791,7 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static struct file_operations cpia_fops = {
+static const struct file_operations cpia_fops = {
        .owner          = THIS_MODULE,
        .open           = cpia_open,
        .release        = cpia_close,
index d09f499..1bda7ad 100644 (file)
@@ -1924,7 +1924,7 @@ static void reset_camera_struct_v4l(struct camera_data *cam)
 /***
  * The v4l video device structure initialized for this device
  ***/
-static struct file_operations fops_template = {
+static const struct file_operations fops_template = {
        .owner          = THIS_MODULE,
        .open           = cpia2_open,
        .release        = cpia2_close,
index 0cf0360..9a7a299 100644 (file)
@@ -1051,7 +1051,7 @@ mpeg_mmap(struct file *file, struct vm_area_struct * vma)
        return videobuf_mmap_mapper(&fh->mpegq, vma);
 }
 
-static struct file_operations mpeg_fops =
+static const struct file_operations mpeg_fops =
 {
        .owner         = THIS_MODULE,
        .open          = mpeg_open,
index 8613378..c86a7e0 100644 (file)
@@ -1808,7 +1808,7 @@ static irqreturn_t cx8800_irq(int irq, void *dev_id)
 /* ----------------------------------------------------------- */
 /* exported stuff                                              */
 
-static struct file_operations video_fops =
+static const struct file_operations video_fops =
 {
        .owner         = THIS_MODULE,
        .open          = video_open,
@@ -1839,7 +1839,7 @@ static struct video_device cx8800_vbi_template =
        .minor         = -1,
 };
 
-static struct file_operations radio_fops =
+static const struct file_operations radio_fops =
 {
        .owner         = THIS_MODULE,
        .open          = video_open,
index 917021f..ff4b238 100644 (file)
@@ -696,7 +696,7 @@ static int dabusb_ioctl (struct inode *inode, struct file *file, unsigned int cm
        return ret;
 }
 
-static struct file_operations dabusb_fops =
+static const struct file_operations dabusb_fops =
 {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
index 36e72c2..bec6760 100644 (file)
@@ -1480,7 +1480,7 @@ static int em28xx_v4l2_ioctl(struct inode *inode, struct file *filp,
        return ret;
 }
 
-static struct file_operations em28xx_v4l_fops = {
+static const struct file_operations em28xx_v4l_fops = {
        .owner = THIS_MODULE,
        .open = em28xx_v4l2_open,
        .release = em28xx_v4l2_close,
index 86e353b..49792ae 100644 (file)
@@ -2454,7 +2454,7 @@ static int et61x251_ioctl(struct inode* inode, struct file* filp,
 }
 
 
-static struct file_operations et61x251_fops = {
+static const struct file_operations et61x251_fops = {
        .owner = THIS_MODULE,
        .open =    et61x251_open,
        .release = et61x251_release,
index 616a35d..9528e10 100644 (file)
@@ -1748,7 +1748,7 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static struct file_operations meye_fops = {
+static const struct file_operations meye_fops = {
        .owner          = THIS_MODULE,
        .open           = meye_open,
        .release        = meye_release,
index b4db2cb..e5edff1 100644 (file)
@@ -4653,7 +4653,7 @@ ov51x_v4l1_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static struct file_operations ov511_fops = {
+static const struct file_operations ov511_fops = {
        .owner =        THIS_MODULE,
        .open =         ov51x_v4l1_open,
        .release =      ov51x_v4l1_close,
index 5d681fa..d38d3dc 100644 (file)
@@ -881,7 +881,7 @@ static ssize_t pms_read(struct file *file, char __user *buf,
        return len;
 }
 
-static struct file_operations pms_fops = {
+static const struct file_operations pms_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index bb40e90..6cf1708 100644 (file)
@@ -986,7 +986,7 @@ static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait)
 }
 
 
-static struct file_operations vdev_fops = {
+static const struct file_operations vdev_fops = {
        .owner      = THIS_MODULE,
        .open       = pvr2_v4l2_open,
        .release    = pvr2_v4l2_release,
index a996aad..9825fd3 100644 (file)
@@ -152,7 +152,7 @@ static int  pwc_video_ioctl(struct inode *inode, struct file *file,
                            unsigned int ioctlnr, unsigned long arg);
 static int  pwc_video_mmap(struct file *file, struct vm_area_struct *vma);
 
-static struct file_operations pwc_fops = {
+static const struct file_operations pwc_fops = {
        .owner =        THIS_MODULE,
        .open =         pwc_video_open,
        .release =      pwc_video_close,
index 77bb940..0b5d159 100644 (file)
@@ -817,7 +817,7 @@ static void __exit cleanup_saa_5246a (void)
 module_init(init_saa_5246a);
 module_exit(cleanup_saa_5246a);
 
-static struct file_operations saa_fops = {
+static const struct file_operations saa_fops = {
        .owner   = THIS_MODULE,
        .open    = saa5246a_open,
        .release = saa5246a_release,
index bb3fb43..3e84737 100644 (file)
@@ -699,7 +699,7 @@ static void __exit cleanup_saa_5249 (void)
 module_init(init_saa_5249);
 module_exit(cleanup_saa_5249);
 
-static struct file_operations saa_fops = {
+static const struct file_operations saa_fops = {
        .owner          = THIS_MODULE,
        .open           = saa5249_open,
        .release        = saa5249_release,
index daaae87..f521603 100644 (file)
@@ -319,7 +319,7 @@ static int ts_ioctl(struct inode *inode, struct file *file,
        return video_usercopy(inode, file, cmd, arg, ts_do_ioctl);
 }
 
-static struct file_operations ts_fops =
+static const struct file_operations ts_fops =
 {
        .owner    = THIS_MODULE,
        .open     = ts_open,
index bfcb860..72444f0 100644 (file)
@@ -563,7 +563,7 @@ static unsigned int dsp_poll(struct file *file, struct poll_table_struct *wait)
        return mask;
 }
 
-struct file_operations saa7134_dsp_fops = {
+const struct file_operations saa7134_dsp_fops = {
        .owner   = THIS_MODULE,
        .open    = dsp_open,
        .release = dsp_release,
@@ -804,7 +804,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
        }
 }
 
-struct file_operations saa7134_mixer_fops = {
+const struct file_operations saa7134_mixer_fops = {
        .owner   = THIS_MODULE,
        .open    = mixer_open,
        .release = mixer_release,
index 830617e..f2cb630 100644 (file)
@@ -2336,7 +2336,7 @@ static int radio_ioctl(struct inode *inode, struct file *file,
        return video_usercopy(inode, file, cmd, arg, radio_do_ioctl);
 }
 
-static struct file_operations video_fops =
+static const struct file_operations video_fops =
 {
        .owner    = THIS_MODULE,
        .open     = video_open,
@@ -2349,7 +2349,7 @@ static struct file_operations video_fops =
        .llseek   = no_llseek,
 };
 
-static struct file_operations radio_fops =
+static const struct file_operations radio_fops =
 {
        .owner    = THIS_MODULE,
        .open     = video_open,
index e88ad7b..88cd129 100644 (file)
@@ -683,8 +683,8 @@ int saa_dsp_writel(struct saa7134_dev *dev, int reg, u32 value);
 /* ----------------------------------------------------------- */
 /* saa7134-oss.c                                               */
 
-extern struct file_operations saa7134_dsp_fops;
-extern struct file_operations saa7134_mixer_fops;
+extern const struct file_operations saa7134_dsp_fops;
+extern const struct file_operations saa7134_mixer_fops;
 
 int saa7134_oss_init1(struct saa7134_dev *dev);
 int saa7134_oss_fini(struct saa7134_dev *dev);
index 7aeec57..038448f 100644 (file)
@@ -1185,7 +1185,7 @@ static int se401_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static struct file_operations se401_fops = {
+static const struct file_operations se401_fops = {
        .owner =        THIS_MODULE,
        .open =         se401_open,
        .release =      se401_close,
index 18458d4..04d4c8f 100644 (file)
@@ -2736,7 +2736,7 @@ static int sn9c102_ioctl(struct inode* inode, struct file* filp,
 
 /*****************************************************************************/
 
-static struct file_operations sn9c102_fops = {
+static const struct file_operations sn9c102_fops = {
        .owner = THIS_MODULE,
        .open =    sn9c102_open,
        .release = sn9c102_release,
index 525d812..3e736be 100644 (file)
@@ -1901,7 +1901,7 @@ static int saa_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations saa_fops = {
+static const struct file_operations saa_fops = {
        .owner = THIS_MODULE,
        .open = saa_open,
        .release = saa_release,
index a1ec3ac..bf3aa8d 100644 (file)
@@ -1380,7 +1380,7 @@ static ssize_t stv680_read (struct file *file, char __user *buf,
        return realcount;
 }                              /* stv680_read */
 
-static struct file_operations stv680_fops = {
+static const struct file_operations stv680_fops = {
        .owner =        THIS_MODULE,
        .open =         stv_open,
        .release =      stv_close,
index 1654576..e2747bd 100644 (file)
@@ -228,7 +228,7 @@ static struct i2c_driver driver = {
        .detach_client   = tvmixer_clients,
 };
 
-static struct file_operations tvmixer_fops = {
+static const struct file_operations tvmixer_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .ioctl          = tvmixer_ioctl,
index b560c9d..d34d8c8 100644 (file)
@@ -945,7 +945,7 @@ static int usbvideo_find_struct(struct usbvideo *cams)
        return rv;
 }
 
-static struct file_operations usbvideo_fops = {
+static const struct file_operations usbvideo_fops = {
        .owner =  THIS_MODULE,
        .open =   usbvideo_v4l_open,
        .release =usbvideo_v4l_close,
index 08f9559..876fd27 100644 (file)
@@ -1234,7 +1234,7 @@ static inline void vicam_create_proc_entry(struct vicam_camera *cam) { }
 static inline void vicam_destroy_proc_entry(void *ptr) { }
 #endif
 
-static struct file_operations vicam_fops = {
+static const struct file_operations vicam_fops = {
        .owner          = THIS_MODULE,
        .open           = vicam_open,
        .release        = vicam_close,
index bdd6301..4eb7330 100644 (file)
@@ -1475,7 +1475,7 @@ static int usbvision_vbi_ioctl(struct inode *inode, struct file *file,
 //
 
 // Video template
-static struct file_operations usbvision_fops = {
+static const struct file_operations usbvision_fops = {
        .owner             = THIS_MODULE,
        .open           = usbvision_v4l2_open,
        .release        = usbvision_v4l2_close,
@@ -1496,7 +1496,7 @@ static struct video_device usbvision_video_template = {
 
 
 // Radio template
-static struct file_operations usbvision_radio_fops = {
+static const struct file_operations usbvision_radio_fops = {
        .owner             = THIS_MODULE,
        .open           = usbvision_radio_open,
        .release        = usbvision_radio_close,
@@ -1517,7 +1517,7 @@ static struct video_device usbvision_radio_template=
 
 
 // vbi template
-static struct file_operations usbvision_vbi_fops = {
+static const struct file_operations usbvision_vbi_fops = {
        .owner             = THIS_MODULE,
        .open           = usbvision_vbi_open,
        .release        = usbvision_vbi_close,
index 6a0e8ca..30c3822 100644 (file)
@@ -1561,7 +1561,7 @@ out:
 }
 
 
-static struct file_operations video_fops;
+static const struct file_operations video_fops;
 
 /**
  *     video_register_device - register video4linux devices
@@ -1709,7 +1709,7 @@ void video_unregister_device(struct video_device *vfd)
 /*
  * Video fs operations
  */
-static struct file_operations video_fops=
+static const struct file_operations video_fops=
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
index a373c14..0c658b7 100644 (file)
@@ -4390,7 +4390,7 @@ static int vino_ioctl(struct inode *inode, struct file *file,
 // __initdata
 static int vino_init_stage = 0;
 
-static struct file_operations vino_fops = {
+static const struct file_operations vino_fops = {
        .owner          = THIS_MODULE,
        .open           = vino_open,
        .release        = vino_close,
index d4cf556..cfb6b1f 100644 (file)
@@ -1292,7 +1292,7 @@ vivi_mmap(struct file *file, struct vm_area_struct * vma)
        return ret;
 }
 
-static struct file_operations vivi_fops = {
+static const struct file_operations vivi_fops = {
        .owner          = THIS_MODULE,
        .open           = vivi_open,
        .release        = vivi_release,
index 8d14f30..4736640 100644 (file)
@@ -183,7 +183,7 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
 static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
                              size_t count, loff_t *ppos);
 
-static struct file_operations w9966_fops = {
+static const struct file_operations w9966_fops = {
        .owner          = THIS_MODULE,
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
index 9f403af..6e64af2 100644 (file)
@@ -399,7 +399,7 @@ MODULE_PARM_DESC(specific_debug,
  ****************************************************************************/
 
 /* Video4linux interface */
-static struct file_operations w9968cf_fops;
+static const struct file_operations w9968cf_fops;
 static int w9968cf_open(struct inode*, struct file*);
 static int w9968cf_release(struct inode*, struct file*);
 static int w9968cf_mmap(struct file*, struct vm_area_struct*);
@@ -3466,7 +3466,7 @@ ioctl_fail:
 }
 
 
-static struct file_operations w9968cf_fops = {
+static const struct file_operations w9968cf_fops = {
        .owner =   THIS_MODULE,
        .open =    w9968cf_open,
        .release = w9968cf_release,
index 52d0f75..8da7f15 100644 (file)
@@ -1871,7 +1871,7 @@ static int zc0301_ioctl(struct inode* inode, struct file* filp,
 }
 
 
-static struct file_operations zc0301_fops = {
+static const struct file_operations zc0301_fops = {
        .owner =   THIS_MODULE,
        .open =    zc0301_open,
        .release = zc0301_release,
index e10a9ee..0743237 100644 (file)
@@ -4679,7 +4679,7 @@ zoran_mmap (struct file           *file,
        return 0;
 }
 
-static struct file_operations zoran_fops = {
+static const struct file_operations zoran_fops = {
        .owner = THIS_MODULE,
        .open = zoran_open,
        .release = zoran_close,
index c374c76..446ae8d 100644 (file)
@@ -186,7 +186,7 @@ static ssize_t zoran_write(struct file *file, const char __user *buffer,
        return count;
 }
 
-static struct file_operations zoran_operations = {
+static const struct file_operations zoran_operations = {
        .open           = zoran_open,
        .read           = seq_read,
        .write          = zoran_write,
index b0b8042..9d0f304 100644 (file)
@@ -2662,7 +2662,7 @@ mptctl_hp_targetinfo(unsigned long arg)
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
-static struct file_operations mptctl_fops = {
+static const struct file_operations mptctl_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .release =      mptctl_release,