diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 00:55:35 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 09:48:46 -0800 |
commit | 9a32144e9d7b4e21341174b1a83b82a82353be86 (patch) | |
tree | 6f08560b341418fc9934f56f6162a95f5b5d8aec /net/core | |
parent | 00977a59b951207d38380c75f03a36829950265c (diff) |
[PATCH] mark struct file_operations const 7
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 <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 'net/core')
-rw-r--r-- | net/core/dev.c | 4 | ||||
-rw-r--r-- | net/core/dev_mcast.c | 2 | ||||
-rw-r--r-- | net/core/neighbour.c | 4 | ||||
-rw-r--r-- | net/core/pktgen.c | 6 | ||||
-rw-r--r-- | net/core/sock.c | 2 | ||||
-rw-r--r-- | net/core/wireless.c | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 85d58d79932..cf71614dae9 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2200,7 +2200,7 @@ static int dev_seq_open(struct inode *inode, struct file *file) return seq_open(file, &dev_seq_ops); } -static struct file_operations dev_seq_fops = { +static const struct file_operations dev_seq_fops = { .owner = THIS_MODULE, .open = dev_seq_open, .read = seq_read, @@ -2220,7 +2220,7 @@ static int softnet_seq_open(struct inode *inode, struct file *file) return seq_open(file, &softnet_seq_ops); } -static struct file_operations softnet_seq_fops = { +static const struct file_operations softnet_seq_fops = { .owner = THIS_MODULE, .open = softnet_seq_open, .read = seq_read, diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index bfcbdf73a29..c4e754e86e9 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c @@ -277,7 +277,7 @@ static int dev_mc_seq_open(struct inode *inode, struct file *file) return seq_open(file, &dev_mc_seq_ops); } -static struct file_operations dev_mc_seq_fops = { +static const struct file_operations dev_mc_seq_fops = { .owner = THIS_MODULE, .open = dev_mc_seq_open, .read = seq_read, diff --git a/net/core/neighbour.c b/net/core/neighbour.c index c08d6965056..512eed91785 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -63,7 +63,7 @@ void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); static struct neigh_table *neigh_tables; #ifdef CONFIG_PROC_FS -static struct file_operations neigh_stat_seq_fops; +static const struct file_operations neigh_stat_seq_fops; #endif /* @@ -2403,7 +2403,7 @@ static int neigh_stat_seq_open(struct inode *inode, struct file *file) return ret; }; -static struct file_operations neigh_stat_seq_fops = { +static const struct file_operations neigh_stat_seq_fops = { .owner = THIS_MODULE, .open = neigh_stat_seq_open, .read = seq_read, diff --git a/net/core/pktgen.c b/net/core/pktgen.c index c2818e07a4b..74a9a32b906 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -579,7 +579,7 @@ static int pgctrl_open(struct inode *inode, struct file *file) return single_open(file, pgctrl_show, PDE(inode)->data); } -static struct file_operations pktgen_fops = { +static const struct file_operations pktgen_fops = { .owner = THIS_MODULE, .open = pgctrl_open, .read = seq_read, @@ -1672,7 +1672,7 @@ static int pktgen_if_open(struct inode *inode, struct file *file) return single_open(file, pktgen_if_show, PDE(inode)->data); } -static struct file_operations pktgen_if_fops = { +static const struct file_operations pktgen_if_fops = { .owner = THIS_MODULE, .open = pktgen_if_open, .read = seq_read, @@ -1815,7 +1815,7 @@ static int pktgen_thread_open(struct inode *inode, struct file *file) return single_open(file, pktgen_thread_show, PDE(inode)->data); } -static struct file_operations pktgen_thread_fops = { +static const struct file_operations pktgen_thread_fops = { .owner = THIS_MODULE, .open = pktgen_thread_open, .read = seq_read, diff --git a/net/core/sock.c b/net/core/sock.c index 1e35d9973f5..e9986acdd0a 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1911,7 +1911,7 @@ static int proto_seq_open(struct inode *inode, struct file *file) return seq_open(file, &proto_seq_ops); } -static struct file_operations proto_seq_fops = { +static const struct file_operations proto_seq_fops = { .owner = THIS_MODULE, .open = proto_seq_open, .read = seq_read, diff --git a/net/core/wireless.c b/net/core/wireless.c index 64017d47b25..9936ab11e6e 100644 --- a/net/core/wireless.c +++ b/net/core/wireless.c @@ -674,7 +674,7 @@ static int wireless_seq_open(struct inode *inode, struct file *file) return seq_open(file, &wireless_seq_ops); } -static struct file_operations wireless_seq_fops = { +static const struct file_operations wireless_seq_fops = { .owner = THIS_MODULE, .open = wireless_seq_open, .read = seq_read, |