From 5dfe4c964a0dd7bb3a1d64a4166835a153146207 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Mon, 12 Feb 2007 00:55:31 -0800 Subject: [PATCH] mark struct file_operations const 2 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. [akpm@osdl.org: sparc64 fix] Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/cris/arch-v32/drivers/cryptocop.c | 2 +- arch/cris/arch-v32/drivers/gpio.c | 2 +- arch/cris/arch-v32/drivers/i2c.c | 2 +- arch/cris/arch-v32/drivers/pcf8563.c | 2 +- arch/cris/arch-v32/drivers/sync_serial.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'arch/cris/arch-v32') diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index 2449637..1a071f1 100644 --- a/arch/cris/arch-v32/drivers/cryptocop.c +++ b/arch/cris/arch-v32/drivers/cryptocop.c @@ -266,7 +266,7 @@ static void print_user_dma_lists(struct cryptocop_dma_list_operation *dma_op); -struct file_operations cryptocop_fops = { +const struct file_operations cryptocop_fops = { owner: THIS_MODULE, open: cryptocop_open, release: cryptocop_release, diff --git a/arch/cris/arch-v32/drivers/gpio.c b/arch/cris/arch-v32/drivers/gpio.c index 08d36f0..d82c5c5 100644 --- a/arch/cris/arch-v32/drivers/gpio.c +++ b/arch/cris/arch-v32/drivers/gpio.c @@ -705,7 +705,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) return 0; } -struct file_operations gpio_fops = { +const struct file_operations gpio_fops = { .owner = THIS_MODULE, .poll = gpio_poll, .ioctl = gpio_ioctl, diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c index 95f0018..5d6c527 100644 --- a/arch/cris/arch-v32/drivers/i2c.c +++ b/arch/cris/arch-v32/drivers/i2c.c @@ -573,7 +573,7 @@ i2c_ioctl(struct inode *inode, struct file *file, return 0; } -static struct file_operations i2c_fops = { +static const struct file_operations i2c_fops = { owner: THIS_MODULE, ioctl: i2c_ioctl, open: i2c_open, diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index 2fc7d75..544ab01 100644 --- a/arch/cris/arch-v32/drivers/pcf8563.c +++ b/arch/cris/arch-v32/drivers/pcf8563.c @@ -50,7 +50,7 @@ int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); int pcf8563_open(struct inode *, struct file *); int pcf8563_release(struct inode *, struct file *); -static struct file_operations pcf8563_fops = { +static const struct file_operations pcf8563_fops = { owner: THIS_MODULE, ioctl: pcf8563_ioctl, open: pcf8563_open, diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 424eb0e..df89298 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c @@ -187,7 +187,7 @@ static struct sync_port ports[]= #define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port)) -static struct file_operations sync_serial_fops = { +static const struct file_operations sync_serial_fops = { .owner = THIS_MODULE, .write = sync_serial_write, .read = sync_serial_read, -- cgit v1.1