summaryrefslogtreecommitdiff
path: root/drivers/char/raw.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-07-03 11:24:21 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-04 02:26:59 +0400
commit62322d2554d2f9680c8ace7bbf1f97d8fa84ad1a (patch)
tree904f8b8354a4079cc1daaa355fe30200dcae9dc9 /drivers/char/raw.c
parentd459ec0baa5d22e111dfb139c46d6d788a9eac20 (diff)
downloadlinux-62322d2554d2f9680c8ace7bbf1f97d8fa84ad1a.tar.xz
[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/raw.c')
-rw-r--r--drivers/char/raw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index 9bf97c5e38c0..579868af4a54 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -30,7 +30,7 @@ struct raw_device_data {
static struct class *raw_class;
static struct raw_device_data raw_devices[MAX_RAW_MINORS];
static DEFINE_MUTEX(raw_mutex);
-static struct file_operations raw_ctl_fops; /* forward declaration */
+static const struct file_operations raw_ctl_fops; /* forward declaration */
/*
* Open/close code for raw IO.
@@ -261,7 +261,7 @@ static ssize_t raw_file_aio_write(struct kiocb *iocb, const char __user *buf,
}
-static struct file_operations raw_fops = {
+static const struct file_operations raw_fops = {
.read = generic_file_read,
.aio_read = generic_file_aio_read,
.write = raw_file_write,
@@ -274,7 +274,7 @@ static struct file_operations raw_fops = {
.owner = THIS_MODULE,
};
-static struct file_operations raw_ctl_fops = {
+static const struct file_operations raw_ctl_fops = {
.ioctl = raw_ctl_ioctl,
.open = raw_open,
.owner = THIS_MODULE,