diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2007-02-12 03:55:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:46 -0500 |
commit | 9a32144e9d7b4e21341174b1a83b82a82353be86 (patch) | |
tree | 6f08560b341418fc9934f56f6162a95f5b5d8aec /net/core/pktgen.c | |
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/pktgen.c')
-rw-r--r-- | net/core/pktgen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index c2818e07a4bd..74a9a32b906d 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) | |||
579 | return single_open(file, pgctrl_show, PDE(inode)->data); | 579 | return single_open(file, pgctrl_show, PDE(inode)->data); |
580 | } | 580 | } |
581 | 581 | ||
582 | static struct file_operations pktgen_fops = { | 582 | static const struct file_operations pktgen_fops = { |
583 | .owner = THIS_MODULE, | 583 | .owner = THIS_MODULE, |
584 | .open = pgctrl_open, | 584 | .open = pgctrl_open, |
585 | .read = seq_read, | 585 | .read = seq_read, |
@@ -1672,7 +1672,7 @@ static int pktgen_if_open(struct inode *inode, struct file *file) | |||
1672 | return single_open(file, pktgen_if_show, PDE(inode)->data); | 1672 | return single_open(file, pktgen_if_show, PDE(inode)->data); |
1673 | } | 1673 | } |
1674 | 1674 | ||
1675 | static struct file_operations pktgen_if_fops = { | 1675 | static const struct file_operations pktgen_if_fops = { |
1676 | .owner = THIS_MODULE, | 1676 | .owner = THIS_MODULE, |
1677 | .open = pktgen_if_open, | 1677 | .open = pktgen_if_open, |
1678 | .read = seq_read, | 1678 | .read = seq_read, |
@@ -1815,7 +1815,7 @@ static int pktgen_thread_open(struct inode *inode, struct file *file) | |||
1815 | return single_open(file, pktgen_thread_show, PDE(inode)->data); | 1815 | return single_open(file, pktgen_thread_show, PDE(inode)->data); |
1816 | } | 1816 | } |
1817 | 1817 | ||
1818 | static struct file_operations pktgen_thread_fops = { | 1818 | static const struct file_operations pktgen_thread_fops = { |
1819 | .owner = THIS_MODULE, | 1819 | .owner = THIS_MODULE, |
1820 | .open = pktgen_thread_open, | 1820 | .open = pktgen_thread_open, |
1821 | .read = seq_read, | 1821 | .read = seq_read, |