diff options
author | Arjan van de Ven | 2007-02-12 00:55:34 -0800 |
---|---|---|
committer | Linus Torvalds | 2007-02-12 09:48:45 -0800 |
commit | 00977a59b951207d38380c75f03a36829950265c (patch) | |
tree | 26933feafebffca95df02c19df03f5e56aada47e /drivers | |
parent | d54b1fdb1d9f82e375a299e22bd366aad52d4c34 (diff) |
[PATCH] mark struct file_operations const 6
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.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
30 files changed, 36 insertions, 36 deletions
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c index ac7d1258efee..a39ee80c9715 100644 --- a/drivers/sbus/char/bpp.c +++ b/drivers/sbus/char/bpp.c @@ -846,7 +846,7 @@ static int bpp_ioctl(struct inode *inode, struct file *f, unsigned int cmd, return errno; } -static struct file_operations bpp_fops = { +static const struct file_operations bpp_fops = { .owner = THIS_MODULE, .read = bpp_read, .write = bpp_write, diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c index ad1c7db96cb4..0cfd1e4c032c 100644 --- a/drivers/sbus/char/cpwatchdog.c +++ b/drivers/sbus/char/cpwatchdog.c @@ -459,7 +459,7 @@ static irqreturn_t wd_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct file_operations wd_fops = { +static const struct file_operations wd_fops = { .owner = THIS_MODULE, .ioctl = wd_ioctl, .compat_ioctl = wd_compat_ioctl, diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c index a4909e0c7f83..2d14a29effe4 100644 --- a/drivers/sbus/char/display7seg.c +++ b/drivers/sbus/char/display7seg.c @@ -166,7 +166,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return error; } -static struct file_operations d7s_fops = { +static const struct file_operations d7s_fops = { .owner = THIS_MODULE, .unlocked_ioctl = d7s_ioctl, .compat_ioctl = d7s_ioctl, diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index fff4660cdf96..2cea4f5d2084 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c @@ -705,7 +705,7 @@ envctrl_release(struct inode *inode, struct file *file) return 0; } -static struct file_operations envctrl_fops = { +static const struct file_operations envctrl_fops = { .owner = THIS_MODULE, .read = envctrl_read, .unlocked_ioctl = envctrl_ioctl, diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index fa2418f7ad39..6e99507aeb12 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c @@ -142,7 +142,7 @@ flash_release(struct inode *inode, struct file *file) return 0; } -static struct file_operations flash_fops = { +static const struct file_operations flash_fops = { /* no write to the Flash, use mmap * and play flash dependent tricks. */ diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c index 14631ac11bc7..512857a23169 100644 --- a/drivers/sbus/char/jsflash.c +++ b/drivers/sbus/char/jsflash.c @@ -431,7 +431,7 @@ static int jsf_release(struct inode *inode, struct file *file) return 0; } -static struct file_operations jsf_fops = { +static const struct file_operations jsf_fops = { .owner = THIS_MODULE, .llseek = jsf_lseek, .read = jsf_read, diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 4e2a0e2dcc2e..e8776230782b 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c @@ -704,7 +704,7 @@ static int openprom_release(struct inode * inode, struct file * file) return 0; } -static struct file_operations openprom_fops = { +static const struct file_operations openprom_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = openprom_ioctl, diff --git a/drivers/sbus/char/riowatchdog.c b/drivers/sbus/char/riowatchdog.c index 2a9cc8204429..a2fc6b8c1334 100644 --- a/drivers/sbus/char/riowatchdog.c +++ b/drivers/sbus/char/riowatchdog.c @@ -193,7 +193,7 @@ static ssize_t riowd_write(struct file *file, const char __user *buf, size_t cou return 0; } -static struct file_operations riowd_fops = { +static const struct file_operations riowd_fops = { .owner = THIS_MODULE, .ioctl = riowd_ioctl, .open = riowd_open, diff --git a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c index 9b988baf0b51..94d185829119 100644 --- a/drivers/sbus/char/rtc.c +++ b/drivers/sbus/char/rtc.c @@ -233,7 +233,7 @@ static int rtc_release(struct inode *inode, struct file *file) return 0; } -static struct file_operations rtc_fops = { +static const struct file_operations rtc_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = rtc_ioctl, diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index b30372f17f1c..4d1a505e9e74 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c @@ -224,7 +224,7 @@ static irqreturn_t uctrl_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct file_operations uctrl_fops = { +static const struct file_operations uctrl_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = uctrl_ioctl, diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 386e7de0b7e3..37a04a0cecfa 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c @@ -44,7 +44,7 @@ #include "vfc.h" #include <asm/vfc_ioctls.h> -static struct file_operations vfc_fops; +static const struct file_operations vfc_fops; struct vfc_dev **vfc_dev_lst; static char vfcstr[]="vfc"; static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { @@ -633,7 +633,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma) } -static struct file_operations vfc_fops = { +static const struct file_operations vfc_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = vfc_ioctl, diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index b091a0fc4eb0..eb766c3af1c8 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -197,7 +197,7 @@ static struct class_device_attribute *twa_host_attrs[] = { }; /* File operations struct for character device */ -static struct file_operations twa_fops = { +static const struct file_operations twa_fops = { .owner = THIS_MODULE, .ioctl = twa_chrdev_ioctl, .open = twa_chrdev_open, diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index e1b44d6c0c32..bf5d63e1beee 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -1040,7 +1040,7 @@ static int tw_chrdev_open(struct inode *inode, struct file *file) } /* End tw_chrdev_open() */ /* File operations struct for character device */ -static struct file_operations tw_fops = { +static const struct file_operations tw_fops = { .owner = THIS_MODULE, .ioctl = tw_chrdev_ioctl, .open = tw_chrdev_open, diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index a9734e08fe28..0f948c2fb609 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -774,7 +774,7 @@ static struct class_device_attribute *aac_attrs[] = { }; -static struct file_operations aac_cfg_fops = { +static const struct file_operations aac_cfg_fops = { .owner = THIS_MODULE, .ioctl = aac_cfg_ioctl, #ifdef CONFIG_COMPAT diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index f6caa4307768..d02759f13469 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -129,7 +129,7 @@ static struct scsi_driver ch_template = }, }; -static struct file_operations changer_fops = +static const struct file_operations changer_fops = { .owner = THIS_MODULE, .open = ch_open, diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 365db537a28d..cd36e81b2d93 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -116,7 +116,7 @@ static int sys_tbl_len = 0; static adpt_hba* hba_chain = NULL; static int hba_count = 0; -static struct file_operations adpt_fops = { +static const struct file_operations adpt_fops = { .ioctl = adpt_ioctl, .open = adpt_open, .release = adpt_close diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 4c698a71f66f..a1992928e671 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -687,7 +687,7 @@ MODULE_AUTHOR("Achim Leubner"); MODULE_LICENSE("GPL"); /* ioctl interface */ -static struct file_operations gdth_fops = { +static const struct file_operations gdth_fops = { .ioctl = gdth_ioctl, .open = gdth_open, .release = gdth_close, diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 77d9d3804ccf..808a1b8c4043 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -92,7 +92,7 @@ static struct mega_hbas mega_hbas[MAX_CONTROLLERS]; /* * The File Operations structure for the serial/ioctl interface of the driver */ -static struct file_operations megadev_fops = { +static const struct file_operations megadev_fops = { .owner = THIS_MODULE, .ioctl = megadev_ioctl, .open = megadev_open, diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index c1ff20c4747d..f33a678f0897 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -67,7 +67,7 @@ static struct list_head adapters_list_g; static wait_queue_head_t wait_q; -static struct file_operations lsi_fops = { +static const struct file_operations lsi_fops = { .open = mraid_mm_open, .ioctl = mraid_mm_ioctl, #ifdef CONFIG_COMPAT diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index b5bdd0d7a8bf..15e24fcc84f3 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c @@ -2913,7 +2913,7 @@ megasas_mgmt_compat_ioctl(struct file *file, unsigned int cmd, /* * File operations structure for management interface */ -static struct file_operations megasas_mgmt_fops = { +static const struct file_operations megasas_mgmt_fops = { .owner = THIS_MODULE, .open = megasas_mgmt_open, .release = megasas_mgmt_release, diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index bd6bbf61adb8..9668b73872c7 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c @@ -5522,7 +5522,7 @@ __setup("osst=", osst_setup); #endif -static struct file_operations osst_fops = { +static const struct file_operations osst_fops = { .owner = THIS_MODULE, .read = osst_read, .write = osst_write, diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index 524a5f7a5193..69d6e9b198c4 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -308,7 +308,7 @@ static int proc_scsi_open(struct inode *inode, struct file *file) return single_open(file, proc_scsi_show, NULL); } -static struct file_operations proc_scsi_operations = { +static const struct file_operations proc_scsi_operations = { .open = proc_scsi_open, .read = seq_read, .write = proc_scsi_write, diff --git a/drivers/scsi/scsi_tgt_if.c b/drivers/scsi/scsi_tgt_if.c index 37bbfbdb870f..f2344ab8deff 100644 --- a/drivers/scsi/scsi_tgt_if.c +++ b/drivers/scsi/scsi_tgt_if.c @@ -280,7 +280,7 @@ static int tgt_open(struct inode *inode, struct file *file) return 0; } -static struct file_operations tgt_fops = { +static const struct file_operations tgt_fops = { .owner = THIS_MODULE, .open = tgt_open, .poll = tgt_poll, diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 16e279be4a3e..3d2e02381e92 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -3864,7 +3864,7 @@ __setup("st=", st_setup); #endif -static struct file_operations st_fops = +static const struct file_operations st_fops = { .owner = THIS_MODULE, .read = st_read, diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index 58deaac5b373..71cb64e41a1b 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c @@ -6663,7 +6663,7 @@ static int ixj_fasync(int fd, struct file *file_p, int mode) return fasync_helper(fd, file_p, mode, &j->async_queue); } -static struct file_operations ixj_fops = +static const struct file_operations ixj_fops = { .owner = THIS_MODULE, .read = ixj_enhanced_read, diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c index e41f49afd0f4..4d8c2a5b3297 100644 --- a/drivers/telephony/phonedev.c +++ b/drivers/telephony/phonedev.c @@ -127,7 +127,7 @@ void phone_unregister_device(struct phone_device *pfd) } -static struct file_operations phone_fops = +static const struct file_operations phone_fops = { .owner = THIS_MODULE, .open = phone_open, diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index af2934e016a7..75bfab95ab3c 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -644,7 +644,7 @@ exit: } /* file operations needed when we register this driver */ -static struct file_operations adu_fops = { +static const struct file_operations adu_fops = { .owner = THIS_MODULE, .read = adu_read, .write = adu_write, diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index 41c0161abdb9..0c1d66ddb812 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c @@ -1209,7 +1209,7 @@ error_1: return retval; } -static struct file_operations ftdi_elan_fops = { +static const struct file_operations ftdi_elan_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = ftdi_elan_ioctl, diff --git a/drivers/video/mbx/mbxdebugfs.c b/drivers/video/mbx/mbxdebugfs.c index 472a3ca3d92d..15b8b3c4330e 100644 --- a/drivers/video/mbx/mbxdebugfs.c +++ b/drivers/video/mbx/mbxdebugfs.c @@ -170,37 +170,37 @@ static ssize_t misc_read_file(struct file *file, char __user *userbuf, } -static struct file_operations sysconf_fops = { +static const struct file_operations sysconf_fops = { .read = sysconf_read_file, .write = write_file_dummy, .open = open_file_generic, }; -static struct file_operations clock_fops = { +static const struct file_operations clock_fops = { .read = clock_read_file, .write = write_file_dummy, .open = open_file_generic, }; -static struct file_operations display_fops = { +static const struct file_operations display_fops = { .read = display_read_file, .write = write_file_dummy, .open = open_file_generic, }; -static struct file_operations gsctl_fops = { +static const struct file_operations gsctl_fops = { .read = gsctl_read_file, .write = write_file_dummy, .open = open_file_generic, }; -static struct file_operations sdram_fops = { +static const struct file_operations sdram_fops = { .read = sdram_read_file, .write = write_file_dummy, .open = open_file_generic, }; -static struct file_operations misc_fops = { +static const struct file_operations misc_fops = { .read = misc_read_file, .write = write_file_dummy, .open = open_file_generic, diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c index 60b05bc15642..b3ce8859a586 100644 --- a/drivers/zorro/proc.c +++ b/drivers/zorro/proc.c @@ -75,7 +75,7 @@ proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t * return nbytes; } -static struct file_operations proc_bus_zorro_operations = { +static const struct file_operations proc_bus_zorro_operations = { .llseek = proc_bus_zorro_lseek, .read = proc_bus_zorro_read, }; |