diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:44 -0500 |
commit | 5dfe4c964a0dd7bb3a1d64a4166835a153146207 (patch) | |
tree | 2fb2fd8c09922be4f40a5a9ac50b537b1d780e27 /arch/cris/arch-v32 | |
parent | 540473208f8ac71c25a87e1a2670c3c18dd4d6db (diff) |
[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 <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 'arch/cris/arch-v32')
-rw-r--r-- | arch/cris/arch-v32/drivers/cryptocop.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/gpio.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/i2c.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/pcf8563.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/sync_serial.c | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index 2449637e6fc0..1a071f17446d 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); | |||
266 | 266 | ||
267 | 267 | ||
268 | 268 | ||
269 | struct file_operations cryptocop_fops = { | 269 | const struct file_operations cryptocop_fops = { |
270 | owner: THIS_MODULE, | 270 | owner: THIS_MODULE, |
271 | open: cryptocop_open, | 271 | open: cryptocop_open, |
272 | release: cryptocop_release, | 272 | release: cryptocop_release, |
diff --git a/arch/cris/arch-v32/drivers/gpio.c b/arch/cris/arch-v32/drivers/gpio.c index 08d36f0955c6..d82c5c561135 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) | |||
705 | return 0; | 705 | return 0; |
706 | } | 706 | } |
707 | 707 | ||
708 | struct file_operations gpio_fops = { | 708 | const struct file_operations gpio_fops = { |
709 | .owner = THIS_MODULE, | 709 | .owner = THIS_MODULE, |
710 | .poll = gpio_poll, | 710 | .poll = gpio_poll, |
711 | .ioctl = gpio_ioctl, | 711 | .ioctl = gpio_ioctl, |
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c index 95f00188c628..5d6c52737df3 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, | |||
573 | return 0; | 573 | return 0; |
574 | } | 574 | } |
575 | 575 | ||
576 | static struct file_operations i2c_fops = { | 576 | static const struct file_operations i2c_fops = { |
577 | owner: THIS_MODULE, | 577 | owner: THIS_MODULE, |
578 | ioctl: i2c_ioctl, | 578 | ioctl: i2c_ioctl, |
579 | open: i2c_open, | 579 | open: i2c_open, |
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index 2fc7d75a35de..544ab0179411 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); | |||
50 | int pcf8563_open(struct inode *, struct file *); | 50 | int pcf8563_open(struct inode *, struct file *); |
51 | int pcf8563_release(struct inode *, struct file *); | 51 | int pcf8563_release(struct inode *, struct file *); |
52 | 52 | ||
53 | static struct file_operations pcf8563_fops = { | 53 | static const struct file_operations pcf8563_fops = { |
54 | owner: THIS_MODULE, | 54 | owner: THIS_MODULE, |
55 | ioctl: pcf8563_ioctl, | 55 | ioctl: pcf8563_ioctl, |
56 | open: pcf8563_open, | 56 | open: pcf8563_open, |
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 424eb0eb1cd5..df89298aafc4 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[]= | |||
187 | 187 | ||
188 | #define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port)) | 188 | #define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port)) |
189 | 189 | ||
190 | static struct file_operations sync_serial_fops = { | 190 | static const struct file_operations sync_serial_fops = { |
191 | .owner = THIS_MODULE, | 191 | .owner = THIS_MODULE, |
192 | .write = sync_serial_write, | 192 | .write = sync_serial_write, |
193 | .read = sync_serial_read, | 193 | .read = sync_serial_read, |