mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
[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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
d54b1fdb1d
commit
00977a59b9
45 changed files with 91 additions and 91 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue