summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2007-02-12 00:55:32 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 09:48:45 -0800
commit2b8693c0617e972fc0b2fd1ebf8de97e15b656c3 (patch)
tree3eb7dfbc8d5e4031e4992bdd566e211f5ada71f3 /drivers/char
parent5dfe4c964a0dd7bb3a1d64a4166835a153146207 (diff)
[PATCH] mark struct file_operations const 3
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/char')
-rw-r--r--drivers/char/briq_panel.c2
-rw-r--r--drivers/char/drm/drm_drv.c2
-rw-r--r--drivers/char/drm/i810_dma.c2
-rw-r--r--drivers/char/drm/i830_dma.c2
-rw-r--r--drivers/char/generic_nvram.c2
-rw-r--r--drivers/char/mbcs.c2
-rw-r--r--drivers/char/mspec.c6
-rw-r--r--drivers/char/random.c4
-rw-r--r--drivers/char/tpm/tpm_bios.c4
-rw-r--r--drivers/char/viotape.c2
-rw-r--r--drivers/char/watchdog/iTCO_wdt.c2
-rw-r--r--drivers/char/watchdog/omap_wdt.c2
-rw-r--r--drivers/char/watchdog/pc87413_wdt.c2
-rw-r--r--drivers/char/watchdog/pnx4008_wdt.c2
-rw-r--r--drivers/char/watchdog/rm9k_wdt.c2
-rw-r--r--drivers/char/watchdog/smsc37b787_wdt.c2
-rw-r--r--drivers/char/watchdog/w83697hf_wdt.c2
17 files changed, 21 insertions, 21 deletions
diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c
index 9f8082f8dd29..7f60a18ef76b 100644
--- a/drivers/char/briq_panel.c
+++ b/drivers/char/briq_panel.c
@@ -187,7 +187,7 @@ static ssize_t briq_panel_write(struct file *file, const char __user *buf, size_
return len;
}
-static struct file_operations briq_panel_fops = {
+static const struct file_operations briq_panel_fops = {
.owner = THIS_MODULE,
.read = briq_panel_read,
.write = briq_panel_write,
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c
index a70af0de4453..f5b9b2480c14 100644
--- a/drivers/char/drm/drm_drv.c
+++ b/drivers/char/drm/drm_drv.c
@@ -371,7 +371,7 @@ void drm_exit(struct drm_driver *driver)
EXPORT_SYMBOL(drm_exit);
/** File operations structure */
-static struct file_operations drm_stub_fops = {
+static const struct file_operations drm_stub_fops = {
.owner = THIS_MODULE,
.open = drm_stub_open
};
diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c
index 60cb4e45a75e..603d17fd2d69 100644
--- a/drivers/char/drm/i810_dma.c
+++ b/drivers/char/drm/i810_dma.c
@@ -112,7 +112,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
return 0;
}
-static struct file_operations i810_buffer_fops = {
+static const struct file_operations i810_buffer_fops = {
.open = drm_open,
.release = drm_release,
.ioctl = drm_ioctl,
diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c
index 95224455ec0c..3314a9fea9e5 100644
--- a/drivers/char/drm/i830_dma.c
+++ b/drivers/char/drm/i830_dma.c
@@ -114,7 +114,7 @@ static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
return 0;
}
-static struct file_operations i830_buffer_fops = {
+static const struct file_operations i830_buffer_fops = {
.open = drm_open,
.release = drm_release,
.ioctl = drm_ioctl,
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c
index 43ff59816511..2398e864c28d 100644
--- a/drivers/char/generic_nvram.c
+++ b/drivers/char/generic_nvram.c
@@ -117,7 +117,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,
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c
index 0afb7ba999cf..57f9115a456c 100644
--- a/drivers/char/mbcs.c
+++ b/drivers/char/mbcs.c
@@ -46,7 +46,7 @@ LIST_HEAD(soft_list);
/*
* file operations
*/
-struct file_operations mbcs_ops = {
+const struct file_operations mbcs_ops = {
.open = mbcs_open,
.llseek = mbcs_sram_llseek,
.read = mbcs_sram_read,
diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c
index 235e89226112..7ac30612068b 100644
--- a/drivers/char/mspec.c
+++ b/drivers/char/mspec.c
@@ -291,7 +291,7 @@ uncached_mmap(struct file *file, struct vm_area_struct *vma)
return mspec_mmap(file, vma, MSPEC_UNCACHED);
}
-static struct file_operations fetchop_fops = {
+static const struct file_operations fetchop_fops = {
.owner = THIS_MODULE,
.mmap = fetchop_mmap
};
@@ -302,7 +302,7 @@ static struct miscdevice fetchop_miscdev = {
.fops = &fetchop_fops
};
-static struct file_operations cached_fops = {
+static const struct file_operations cached_fops = {
.owner = THIS_MODULE,
.mmap = cached_mmap
};
@@ -313,7 +313,7 @@ static struct miscdevice cached_miscdev = {
.fops = &cached_fops
};
-static struct file_operations uncached_fops = {
+static const struct file_operations uncached_fops = {
.owner = THIS_MODULE,
.mmap = uncached_mmap
};
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 13d0b1350a62..b9dc7aa1dfb3 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1117,14 +1117,14 @@ random_ioctl(struct inode * inode, struct file * file,
}
}
-struct file_operations random_fops = {
+const struct file_operations random_fops = {
.read = random_read,
.write = random_write,
.poll = random_poll,
.ioctl = random_ioctl,
};
-struct file_operations urandom_fops = {
+const struct file_operations urandom_fops = {
.read = urandom_read,
.write = random_write,
.ioctl = random_ioctl,
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c
index 7fca5f470beb..4eba32b23b29 100644
--- a/drivers/char/tpm/tpm_bios.c
+++ b/drivers/char/tpm/tpm_bios.c
@@ -441,7 +441,7 @@ static int tpm_ascii_bios_measurements_open(struct inode *inode,
return err;
}
-struct file_operations tpm_ascii_bios_measurements_ops = {
+const struct file_operations tpm_ascii_bios_measurements_ops = {
.open = tpm_ascii_bios_measurements_open,
.read = seq_read,
.llseek = seq_lseek,
@@ -474,7 +474,7 @@ static int tpm_binary_bios_measurements_open(struct inode *inode,
return err;
}
-struct file_operations tpm_binary_bios_measurements_ops = {
+const struct file_operations tpm_binary_bios_measurements_ops = {
.open = tpm_binary_bios_measurements_open,
.read = seq_read,
.llseek = seq_lseek,
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index 9438512b17f1..13faf8d17482 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -872,7 +872,7 @@ free_op:
return ret;
}
-struct file_operations viotap_fops = {
+const struct file_operations viotap_fops = {
owner: THIS_MODULE,
read: viotap_read,
write: viotap_write,
diff --git a/drivers/char/watchdog/iTCO_wdt.c b/drivers/char/watchdog/iTCO_wdt.c
index 7eac922df867..fd8a44a08cd3 100644
--- a/drivers/char/watchdog/iTCO_wdt.c
+++ b/drivers/char/watchdog/iTCO_wdt.c
@@ -539,7 +539,7 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file,
* Kernel Interfaces
*/
-static struct file_operations iTCO_wdt_fops = {
+static const struct file_operations iTCO_wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = iTCO_wdt_write,
diff --git a/drivers/char/watchdog/omap_wdt.c b/drivers/char/watchdog/omap_wdt.c
index 6c6f97332dbb..84074a697dce 100644
--- a/drivers/char/watchdog/omap_wdt.c
+++ b/drivers/char/watchdog/omap_wdt.c
@@ -230,7 +230,7 @@ omap_wdt_ioctl(struct inode *inode, struct file *file,
}
}
-static struct file_operations omap_wdt_fops = {
+static const struct file_operations omap_wdt_fops = {
.owner = THIS_MODULE,
.write = omap_wdt_write,
.ioctl = omap_wdt_ioctl,
diff --git a/drivers/char/watchdog/pc87413_wdt.c b/drivers/char/watchdog/pc87413_wdt.c
index 1d447e32af41..a77a90717ad2 100644
--- a/drivers/char/watchdog/pc87413_wdt.c
+++ b/drivers/char/watchdog/pc87413_wdt.c
@@ -526,7 +526,7 @@ static int pc87413_notify_sys(struct notifier_block *this,
/* -- Module's structures ---------------------------------------*/
-static struct file_operations pc87413_fops = {
+static const struct file_operations pc87413_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = pc87413_write,
diff --git a/drivers/char/watchdog/pnx4008_wdt.c b/drivers/char/watchdog/pnx4008_wdt.c
index 3a55fc6abcd8..ff6f1ca1e5e7 100644
--- a/drivers/char/watchdog/pnx4008_wdt.c
+++ b/drivers/char/watchdog/pnx4008_wdt.c
@@ -238,7 +238,7 @@ static int pnx4008_wdt_release(struct inode *inode, struct file *file)
return 0;
}
-static struct file_operations pnx4008_wdt_fops = {
+static const struct file_operations pnx4008_wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = pnx4008_wdt_write,
diff --git a/drivers/char/watchdog/rm9k_wdt.c b/drivers/char/watchdog/rm9k_wdt.c
index 7576a13e86bc..b4678839d3bb 100644
--- a/drivers/char/watchdog/rm9k_wdt.c
+++ b/drivers/char/watchdog/rm9k_wdt.c
@@ -95,7 +95,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be disabled once started");
/* Kernel interfaces */
-static struct file_operations fops = {
+static const struct file_operations fops = {
.owner = THIS_MODULE,
.open = wdt_gpi_open,
.release = wdt_gpi_release,
diff --git a/drivers/char/watchdog/smsc37b787_wdt.c b/drivers/char/watchdog/smsc37b787_wdt.c
index 9f56913b484f..a9681d580dd3 100644
--- a/drivers/char/watchdog/smsc37b787_wdt.c
+++ b/drivers/char/watchdog/smsc37b787_wdt.c
@@ -510,7 +510,7 @@ static int wb_smsc_wdt_notify_sys(struct notifier_block *this, unsigned long cod
/* -- Module's structures ---------------------------------------*/
-static struct file_operations wb_smsc_wdt_fops =
+static const struct file_operations wb_smsc_wdt_fops =
{
.owner = THIS_MODULE,
.llseek = no_llseek,
diff --git a/drivers/char/watchdog/w83697hf_wdt.c b/drivers/char/watchdog/w83697hf_wdt.c
index 7768b55487c8..c960ec110dd7 100644
--- a/drivers/char/watchdog/w83697hf_wdt.c
+++ b/drivers/char/watchdog/w83697hf_wdt.c
@@ -323,7 +323,7 @@ wdt_notify_sys(struct notifier_block *this, unsigned long code,
* Kernel Interfaces
*/
-static struct file_operations wdt_fops = {
+static const struct file_operations wdt_fops = {
.owner = THIS_MODULE,
.llseek = no_llseek,
.write = wdt_write,