Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62322d25 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds
Browse files

[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: default avatarArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d459ec0b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1059,7 +1059,7 @@ ioctl_out:
	return ret_val;
}

static struct file_operations agp_fops =
static const struct file_operations agp_fops =
{
	.owner		= THIS_MODULE,
	.llseek		= no_llseek,
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ static int ac_ioctl(struct inode *, struct file *, unsigned int,
		    unsigned long);
static irqreturn_t ac_interrupt(int, void *, struct pt_regs *);

static struct file_operations ac_fops = {
static const struct file_operations ac_fops = {
	.owner = THIS_MODULE,
	.llseek = no_llseek,
	.read = ac_read,
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static int cs5535_gpio_open(struct inode *inode, struct file *file)
	return nonseekable_open(inode, file);
}

static struct file_operations cs5535_gpio_fops = {
static const struct file_operations cs5535_gpio_fops = {
	.owner	= THIS_MODULE,
	.write	= cs5535_gpio_write,
	.read	= cs5535_gpio_read,
+1 −1
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ static unsigned int ds1286_poll(struct file *file, poll_table *wait)
 *	The various file operations we support.
 */

static struct file_operations ds1286_fops = {
static const struct file_operations ds1286_fops = {
	.llseek		= no_llseek,
	.read		= ds1286_read,
	.poll		= ds1286_poll,
+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ get_rtc_status(char *buf)

/* The various file operations we support. */

static struct file_operations rtc_fops = {
static const struct file_operations rtc_fops = {
	.owner		= THIS_MODULE,
	.ioctl		= rtc_ioctl,
};
Loading