[PATCH] make more file_operation structs static
Mark the static struct file_operations in drivers/char as const. Making them const prevents accidental bugs, and moves them to the .rodata section so that they no longer do any false sharing; in addition with the proper debug option they are then protected against corruption.. [akpm@osdl.org: build fix] Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
d459ec0baa
commit
62322d2554
@@ -625,7 +625,7 @@ static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, v
|
||||
* Kernel Interfaces
|
||||
*/
|
||||
|
||||
static struct file_operations pcipcwd_fops = {
|
||||
static const struct file_operations pcipcwd_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.write = pcipcwd_write,
|
||||
@@ -640,7 +640,7 @@ static struct miscdevice pcipcwd_miscdev = {
|
||||
.fops = &pcipcwd_fops,
|
||||
};
|
||||
|
||||
static struct file_operations pcipcwd_temp_fops = {
|
||||
static const struct file_operations pcipcwd_temp_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.llseek = no_llseek,
|
||||
.read = pcipcwd_temp_read,
|
||||
|
Reference in New Issue
Block a user