From 9c2e08c592cd357a8330c34def1e8ecfdcf53275 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 12 Feb 2007 00:55:37 -0800 Subject: [PATCH] mark struct file_operations const 9 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/oss/dmasound/dmasound_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/oss/dmasound') diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c index 80b836e80d9..a0ec886f2aa 100644 --- a/sound/oss/dmasound/dmasound_core.c +++ b/sound/oss/dmasound/dmasound_core.c @@ -371,7 +371,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd, return -EINVAL; } -static struct file_operations mixer_fops = +static const struct file_operations mixer_fops = { .owner = THIS_MODULE, .llseek = no_llseek, @@ -1337,7 +1337,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd, return -EINVAL; } -static struct file_operations sq_fops = +static const struct file_operations sq_fops = { .owner = THIS_MODULE, .llseek = no_llseek, @@ -1561,7 +1561,7 @@ static ssize_t state_read(struct file *file, char __user *buf, size_t count, return n; } -static struct file_operations state_fops = { +static const struct file_operations state_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = state_read, -- cgit v1.2.3