aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-07-03 03:24:21 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-03 18:26:59 -0400
commit62322d2554d2f9680c8ace7bbf1f97d8fa84ad1a (patch)
tree904f8b8354a4079cc1daaa355fe30200dcae9dc9 /drivers/char/tty_io.c
parentd459ec0baa5d22e111dfb139c46d6d788a9eac20 (diff)
[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>
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 615e934da05f..6fb77952562d 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -912,7 +912,7 @@ static int hung_up_tty_ioctl(struct inode * inode, struct file * file,
912 return cmd == TIOCSPGRP ? -ENOTTY : -EIO; 912 return cmd == TIOCSPGRP ? -ENOTTY : -EIO;
913} 913}
914 914
915static struct file_operations tty_fops = { 915static const struct file_operations tty_fops = {
916 .llseek = no_llseek, 916 .llseek = no_llseek,
917 .read = tty_read, 917 .read = tty_read,
918 .write = tty_write, 918 .write = tty_write,
@@ -924,7 +924,7 @@ static struct file_operations tty_fops = {
924}; 924};
925 925
926#ifdef CONFIG_UNIX98_PTYS 926#ifdef CONFIG_UNIX98_PTYS
927static struct file_operations ptmx_fops = { 927static const struct file_operations ptmx_fops = {
928 .llseek = no_llseek, 928 .llseek = no_llseek,
929 .read = tty_read, 929 .read = tty_read,
930 .write = tty_write, 930 .write = tty_write,
@@ -936,7 +936,7 @@ static struct file_operations ptmx_fops = {
936}; 936};
937#endif 937#endif
938 938
939static struct file_operations console_fops = { 939static const struct file_operations console_fops = {
940 .llseek = no_llseek, 940 .llseek = no_llseek,
941 .read = tty_read, 941 .read = tty_read,
942 .write = redirected_tty_write, 942 .write = redirected_tty_write,
@@ -947,7 +947,7 @@ static struct file_operations console_fops = {
947 .fasync = tty_fasync, 947 .fasync = tty_fasync,
948}; 948};
949 949
950static struct file_operations hung_up_tty_fops = { 950static const struct file_operations hung_up_tty_fops = {
951 .llseek = no_llseek, 951 .llseek = no_llseek,
952 .read = hung_up_tty_read, 952 .read = hung_up_tty_read,
953 .write = hung_up_tty_write, 953 .write = hung_up_tty_write,