[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 7cec6de5e2b0704b1a74cfa0d4851d7dda72f983..f729eebf771f80447fd64a42a3919d0fd52d888a 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 2b8a6e821d44b51a52a87854165a5a251484ee81..cdd5a0f72e3c108600b4e49057fd5899bbdd4a7c 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 4300c628f8af813d58113273f1402baba69bd87c..a6d50f4fabd7a9b3bf557af01c2b1c040c10c925 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 30791875fc975176c96b11b43413f9fb548583fc..b195d753d2edb30a85a0a1d1acfce03e332e1ffe 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 6f30459b9385361d0fae5c61f399bafbaa3d67af..3096836d8bd3309e35b459d2684b6688838ff58e 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 eb6653f69ce4dfc60111d5e34d9cbfd2fade4a1b..96bea4b62c43e21fd14cb0bd1fef03d533510ddc 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 93e6ef9233f9ec6bdb9632c06db15e301e666c9c..4f5b6fa196c562e38160bdcc9aa0c885faa75d6f 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 cd6a184536a1c3ec6ca35bd3d912fe25e7d0f804..b441d82c338a32156a6d270eaa1f7cb5553178f9 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 e8807ea5377d75c508e8f791df89eac8ec7ffd65..e85fa75a7912e5c17879e819e21b835b22bce942 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 d867a6a9e43065335894bf93da8f00bc74a46c67..b8dcfa16526665c03aa6342c47ae296acb9bfb92 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 db865a0667e5ae8caed0fd9d8f75c879120ce2d0..df8d0520d1d1e304e47513552e57ff8c7f45eaf1 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 c4312fa0e2f5278d071ef5eea2fe12ae82bf970a..c7c9d1dc06905cb4074c9def7e5bef4c9e05b9d5 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 c1b1db65e66821544b541ca37eed4d9fa2491643..c93490ec96bb7b2f5a4145047e5730fefbf29c9b 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 3368a89bfadbe356d0b4a7ed46ee3389ea3a3bef..b2e88ad289778e70c8abd2c09ace6bee3897d151 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 3ba5fa8cf7e611f1a8f616a63a63b734827e744c..19d45cc940b55dc33a4e680628a2a75e09ba85a2 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 69d4b7919c5aa8b8f3f73783d7fc06d9b14c16ac..8fbf0d8bd2783fcf1ca42238b92fc6eceae16bf0 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 eb14106f66fa28a33777ce7c53cf368512ff9ac7..05e5aa77025f992ecba9af5ac5a2a5697677ca16 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 730fe16126cb9598610e5821d020ce2f8f78f485..36c4be6622c710a6af9de1a680221592022f3476 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 e8ce5f75cf1200630b20cf5981a192c0a39ba4e3..9bba6eb1092537cc45fbcb3087c2e01af07a57b6 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 c2eeae7a10d02eb37e65f1b430ca3deb959edb38..00a2f31d2af32b07c080a041e704f8e013c282d9 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 b9e98483e58d18e9a81c7cb56cd7c9250cd0a1e8..f6683872251ed62dc25f806e731c3ff6424bc269 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 ecc854b4ba386d4c241e1195c810f64a7a5d3b49..f4619e4dda4ff8cbf3fba6a4de766928859d1253 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 4444dce864a932ddeaad7ec8790ca42354d5c9bd..b96fafe1f9da21407c647aab4862caf87f3e64ee 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 f539491a0d76f31e7cdfa874a075c8e24e71a043..d59a27accb843af3e503195b8187478742ac4b39 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 bb03ad5a2033bdb117671ef50d30ba6b72fa8692..6d7f1e7116ead9e24c8d99cd5a2ae4626b6bd5be 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 4a72b4d4e62a70b7c174e6cdac0252f96d84e33a..3031fef178cb491d8ab7f02bc9df062e50d3b863 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 671fe1b1e5bcec6a028c71804699db75dfb976d4..ec08491fb7c54dc509c91d9249c771c4b62f7c15 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 4861799eb4308ce7a6384766caf22263eb17a8f3..649f52f9ad27602c8d27956f9384dc3694fb0d2d 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 ab8f970760f2f5510bf3b136eb11d3195ca6bb59..41fd09d7d11e4dbbb3b714ac9a54b8e667cf615f 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 7d0b6e59c6e2449b3030a70a4584499039a1cd66..7d47cbe6ad25ac23654eb26d5789e5f7d848c843 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 a3989bd2f81bb99b94c49127d36d7f277ba53689..925ff17efbbcbedea434bef38134ef0c1a5ecae2 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 3083c8075d13af459e033af0cbe6544340b08358..fb1410c6f864be4d89e8dd9573787554d68f8e49 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 3b31a0dd2f0cde9645f8740753922161130654df..7e8d5ef58b61f09ecd3a5e3ec592354a1f31e2af 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 d09f49950f2a4be2a885bdfd130ab02825b075b1..1bda7ad9de117b4bc290c8dfbe57b5d682229d62 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 0cf0360588e6c8d30e562f7945f3a5bdd263d143..9a7a2996f20fb75af0a438e331fc567342481b12 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 8613378428fdd45899ed30ef81334e69de78808a..c86a7e06235b35f36411c726f9e83ac2ceb5bbb9 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 917021fc29933ab373ba7641c03d1923bee56026..ff4b238090aca8a866e2e2e42b8d242522c40ae8 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 36e72c207a8fd0f6577c01c5bf894289425291a2..bec67609500fd1b1d34dbc6ac2d675af651f4169 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 86e353b26b53091c8deb0590ee18f272bead6d3a..49792ae8c61c15253b291a0d63e3058e1e3f936f 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 616a35da191d335c1ad8195043d1fa9086d66ccb..9528e10c2828a7fc78aaae5cfafac7de8213f1df 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 b4db2cbb5a84246151e0d39ca589e7ceb50f915e..e5edff1059a28f43f8a7487f25ac859a9c306d13 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 5d681fa8bcb18d80504bb92d1bd58fbd90aabbff..d38d3dc4a0120c0c242daa87150b4ae930856a32 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 bb40e90859778e28d763395ee3d9d8c3b8889fbf..6cf17080eb49c5deaf29f53d2feb40700612800e 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 a996aad79276fdfe13ff75c21e13f1627e7a0fb7..9825fd3481085cf3d0c921ad9b7460633acab64d 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 77bb940a1a4f4159c3a6ceafd41cd839188e5367..0b5d159895bf974724736de08847f981621d13db 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 bb3fb4387f6500ff04dbadf0e003336798c41dd2..3e84737878a866871fb86fec2244b0ba067b761c 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 daaae870a2c4eacdb9956f292aac459fd4968fe6..f521603482cab0ed249995eb740889ef2c2fa4ff 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 bfcb860d14cc4605cff0b5828f4ba3fd75a95f02..72444f039e3d932ceb685f9d3c40408df08d3e1f 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 830617ea81cc5ca0b6c68fce66fe45be112a1fc8..f2cb630530419e946ce5cbbc139df42a67ad0215 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 e88ad7b40c47be8880adfed0c15b6eda922526c7..88cd1297df133f4ec0df4e9bea5928004e12ed72 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 7aeec574d7ce349a99a68ebe9272b5bf45e03fb7..038448f5a9781f3e5ea6463c00d411543fe9e2f4 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 18458d46c0ffde99ddd64c7a25bd0531d653bb18..04d4c8f28b89a97f8f9c345b66c9a38f95cae14a 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 525d81288d55aada3b9308d871e1505a6d3edb11..3e736be5de84496305cb1ac53767881be4df6955 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 a1ec3aca3f918b7ecf816eb81667b087cba69e5e..bf3aa8d2d57e3ccc7ecdcbdf29b4e67e2e041aaa 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 1654576de10e9cd5596178d86f342dd385101ffd..e2747bd373fddd94e1779a7604b18284ef820b67 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 b560c9d7c5168f492809ddab1308d64fab75e297..d34d8c8b73767bb0bab4b94c38f01ff22f1d4a55 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 08f9559a6bfa475e414f7f3b94a52039b32da74d..876fd276824215d35b29e3a539642c80a1df0e15 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 bdd6301d2a47dc6515f172fb37d03a94de528958..4eb7330b96f83107dbdaf63df76dcbaf6163b496 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 6a0e8ca7294803056cf29d11716d7ed175b35e5f..30c3822692fb02d2d1fb0a8242147809ca31c6a1 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 a373c142e74229c9e0c90388d1ab6859d6cec4e0..0c658b74f2c428aabff64c71e106d901e016d15f 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 d4cf5566673149b0708aff82bf42599fa55cc6cb..cfb6b1f0402c0e24885f37b9ad9adcd5a22e0bd3 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 8d14f308f171a9087a9ff87fc64627489c69664e..47366408637c7928a7a097a9ebffda1aa90125f0 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 9f403af7b040773ccba4b4bdaa7255ff21ec59de..6e64af293be58e905b266b12845161f1f7be55d3 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 52d0f759ee0029dbcda52cbaa64112fe89219ad3..8da7f15f62908a52441cb3fe464c78b1186008d0 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 e10a9ee25fc508d30685ba8f8bdf51f114baf857..074323733352739dd1384d8c4fed9167ec332807 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 c374c76b37531efcf3b18f5124cf1e7106f7d8a9..446ae8d5c3df97a9aca4e2541dd9ef6e21b7e212 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 b0b80428d1107bdc082894106660225ea11a6260..9d0f30478e464d5a08a15ed8bcc07a1ef01fe9c7 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,