]> git.openpandora.org Git - pandora-kernel.git/commitdiff
[PATCH] mark struct file_operations const 6
authorArjan van de Ven <arjan@linux.intel.com>
Mon, 12 Feb 2007 08:55:34 +0000 (00:55 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 12 Feb 2007 17:48:45 +0000 (09:48 -0800)
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>
45 files changed:
drivers/sbus/char/bpp.c
drivers/sbus/char/cpwatchdog.c
drivers/sbus/char/display7seg.c
drivers/sbus/char/envctrl.c
drivers/sbus/char/flash.c
drivers/sbus/char/jsflash.c
drivers/sbus/char/openprom.c
drivers/sbus/char/riowatchdog.c
drivers/sbus/char/rtc.c
drivers/sbus/char/uctrl.c
drivers/sbus/char/vfc_dev.c
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-xxxx.c
drivers/scsi/aacraid/linit.c
drivers/scsi/ch.c
drivers/scsi/dpt_i2o.c
drivers/scsi/gdth.c
drivers/scsi/megaraid.c
drivers/scsi/megaraid/megaraid_mm.c
drivers/scsi/megaraid/megaraid_sas.c
drivers/scsi/osst.c
drivers/scsi/scsi_proc.c
drivers/scsi/scsi_tgt_if.c
drivers/scsi/st.c
drivers/telephony/ixj.c
drivers/telephony/phonedev.c
drivers/usb/misc/adutux.c
drivers/usb/misc/ftdi-elan.c
drivers/video/mbx/mbxdebugfs.c
drivers/zorro/proc.c
fs/debugfs/file.c
fs/dlm/debug_fs.c
fs/dlm/user.c
fs/gfs2/locking/dlm/plock.c
fs/nfs/client.c
fs/ocfs2/dlm/dlmfs.c
fs/proc/base.c
fs/proc/generic.c
fs/proc/internal.h
fs/proc/nommu.c
fs/proc/proc_misc.c
fs/proc/proc_tty.c
fs/proc/root.c
fs/proc/task_mmu.c
fs/proc/task_nommu.c

index ac7d1258efee13610244b8e7a81feaf4a0348c7f..a39ee80c9715749b7a1089fa99260128557fe8e9 100644 (file)
@@ -846,7 +846,7 @@ static int bpp_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
       return errno;
 }
 
-static struct file_operations bpp_fops = {
+static const struct file_operations bpp_fops = {
        .owner =        THIS_MODULE,
        .read =         bpp_read,
        .write =        bpp_write,
index ad1c7db96cb4d8eb7bc38f561ff5535f3dd168c7..0cfd1e4c032c479c3ac7c5be5122e0195c4e45d9 100644 (file)
@@ -459,7 +459,7 @@ static irqreturn_t wd_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static struct file_operations wd_fops = {
+static const struct file_operations wd_fops = {
        .owner =        THIS_MODULE,
        .ioctl =        wd_ioctl,
        .compat_ioctl = wd_compat_ioctl,
index a4909e0c7f83877d435869735fa8ecffd30d3808..2d14a29effe4783645c520014d2f85fcb7897401 100644 (file)
@@ -166,7 +166,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        return error;
 }
 
-static struct file_operations d7s_fops = {
+static const struct file_operations d7s_fops = {
        .owner =                THIS_MODULE,
        .unlocked_ioctl =       d7s_ioctl,
        .compat_ioctl =         d7s_ioctl,
index fff4660cdf96e34880f7242d0fdecc588c05536a..2cea4f5d2084b13f85da8114ef554ced2c47b5d9 100644 (file)
@@ -705,7 +705,7 @@ envctrl_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations envctrl_fops = {
+static const struct file_operations envctrl_fops = {
        .owner =                THIS_MODULE,
        .read =                 envctrl_read,
        .unlocked_ioctl =       envctrl_ioctl,
index fa2418f7ad393c78af158a4540fa80cf6213d297..6e99507aeb12c23fba03c52a56697f58d0d216c9 100644 (file)
@@ -142,7 +142,7 @@ flash_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations flash_fops = {
+static const struct file_operations flash_fops = {
        /* no write to the Flash, use mmap
         * and play flash dependent tricks.
         */
index 14631ac11bc7744e95b0276eee662671ca5a522a..512857a23169b4645e1228b7fb46159015cc72df 100644 (file)
@@ -431,7 +431,7 @@ static int jsf_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations jsf_fops = {
+static const struct file_operations jsf_fops = {
        .owner =        THIS_MODULE,
        .llseek =       jsf_lseek,
        .read =         jsf_read,
index 4e2a0e2dcc2e9da9bdde64f2582588694d06f22f..e8776230782b28669606da71a427e591497142ed 100644 (file)
@@ -704,7 +704,7 @@ static int openprom_release(struct inode * inode, struct file * file)
        return 0;
 }
 
-static struct file_operations openprom_fops = {
+static const struct file_operations openprom_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .ioctl =        openprom_ioctl,
index 2a9cc82044292d074b5b3a35d3e8d86f06a43587..a2fc6b8c1334a830dc2808cdc32b8beefd42fbe2 100644 (file)
@@ -193,7 +193,7 @@ static ssize_t riowd_write(struct file *file, const char __user *buf, size_t cou
        return 0;
 }
 
-static struct file_operations riowd_fops = {
+static const struct file_operations riowd_fops = {
        .owner =        THIS_MODULE,
        .ioctl =        riowd_ioctl,
        .open =         riowd_open,
index 9b988baf0b5191304ca00ac042851b055f002bd7..94d185829119bcd7e85a18b4cffd55d4046b4321 100644 (file)
@@ -233,7 +233,7 @@ static int rtc_release(struct inode *inode, struct file *file)
        return 0;
 }
 
-static struct file_operations rtc_fops = {
+static const struct file_operations rtc_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .ioctl =        rtc_ioctl,
index b30372f17f1cb94d9ee924d79ff49ac4b78e4a31..4d1a505e9e74e0bfe090fa557656dce8796ff178 100644 (file)
@@ -224,7 +224,7 @@ static irqreturn_t uctrl_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static struct file_operations uctrl_fops = {
+static const struct file_operations uctrl_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .ioctl =        uctrl_ioctl,
index 386e7de0b7e3c47a38efdda9ed01def8fc6839d6..37a04a0cecfa9449cdc6e1547e77a97eafa9d90c 100644 (file)
@@ -44,7 +44,7 @@
 #include "vfc.h"
 #include <asm/vfc_ioctls.h>
 
-static struct file_operations vfc_fops;
+static const struct file_operations vfc_fops;
 struct vfc_dev **vfc_dev_lst;
 static char vfcstr[]="vfc";
 static unsigned char saa9051_init_array[VFC_SAA9051_NR] = {
@@ -633,7 +633,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma)
 }
 
 
-static struct file_operations vfc_fops = {
+static const struct file_operations vfc_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .ioctl =        vfc_ioctl,
index b091a0fc4eb09fba778206bb9fa53890c524f54f..eb766c3af1c816f30b61c43c0e30a9914c1160c5 100644 (file)
@@ -197,7 +197,7 @@ static struct class_device_attribute *twa_host_attrs[] = {
 };
 
 /* File operations struct for character device */
-static struct file_operations twa_fops = {
+static const struct file_operations twa_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = twa_chrdev_ioctl,
        .open           = twa_chrdev_open,
index e1b44d6c0c32e52e3741b10606573facd6d2d938..bf5d63e1beeeb441ff2f4a82dae2813ef5502964 100644 (file)
@@ -1040,7 +1040,7 @@ static int tw_chrdev_open(struct inode *inode, struct file *file)
 } /* End tw_chrdev_open() */
 
 /* File operations struct for character device */
-static struct file_operations tw_fops = {
+static const struct file_operations tw_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = tw_chrdev_ioctl,
        .open           = tw_chrdev_open,
index a9734e08fe28a7cf35d01727a0ab509c0aff7da3..0f948c2fb6097a7585e8b144699fca5799ed3659 100644 (file)
@@ -774,7 +774,7 @@ static struct class_device_attribute *aac_attrs[] = {
 };
 
 
-static struct file_operations aac_cfg_fops = {
+static const struct file_operations aac_cfg_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = aac_cfg_ioctl,
 #ifdef CONFIG_COMPAT
index f6caa43077680b3a87d1621e3006f40883a1eb35..d02759f1346988245509e0bdb64afc92ba952e1b 100644 (file)
@@ -129,7 +129,7 @@ static struct scsi_driver ch_template =
        },
 };
 
-static struct file_operations changer_fops =
+static const struct file_operations changer_fops =
 {
        .owner        = THIS_MODULE,
        .open         = ch_open,
index 365db537a28da81ddee1d7a1403a50ddc02a0383..cd36e81b2d9348223847dea27dd37c61cf6b7dd0 100644 (file)
@@ -116,7 +116,7 @@ static int sys_tbl_len = 0;
 static adpt_hba* hba_chain = NULL;
 static int hba_count = 0;
 
-static struct file_operations adpt_fops = {
+static const struct file_operations adpt_fops = {
        .ioctl          = adpt_ioctl,
        .open           = adpt_open,
        .release        = adpt_close
index 4c698a71f66ff0b54c6dda5c3859f3b96ff04331..a1992928e6710ec4ff4dc2a0ab5f93a10b4e7bfa 100644 (file)
@@ -687,7 +687,7 @@ MODULE_AUTHOR("Achim Leubner");
 MODULE_LICENSE("GPL");
 
 /* ioctl interface */
-static struct file_operations gdth_fops = {
+static const struct file_operations gdth_fops = {
     .ioctl   = gdth_ioctl,
     .open    = gdth_open,
     .release = gdth_close,
index 77d9d3804ccfd02094a4aba9054081c233ed8427..808a1b8c40431946982847dd446223e396f87b8d 100644 (file)
@@ -92,7 +92,7 @@ static struct mega_hbas mega_hbas[MAX_CONTROLLERS];
 /*
  * The File Operations structure for the serial/ioctl interface of the driver
  */
-static struct file_operations megadev_fops = {
+static const struct file_operations megadev_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = megadev_ioctl,
        .open           = megadev_open,
index c1ff20c4747d960351561c8a954f46ece69cd94c..f33a678f0897d749788ec7e2ed35e742019f1c18 100644 (file)
@@ -67,7 +67,7 @@ static struct list_head adapters_list_g;
 
 static wait_queue_head_t wait_q;
 
-static struct file_operations lsi_fops = {
+static const struct file_operations lsi_fops = {
        .open   = mraid_mm_open,
        .ioctl  = mraid_mm_ioctl,
 #ifdef CONFIG_COMPAT
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/dlm/user.c
Simple merge
Simple merge
diff --cc fs/nfs/client.c
Simple merge
Simple merge
diff --cc fs/proc/base.c
Simple merge
Simple merge
Simple merge
diff --cc fs/proc/nommu.c
Simple merge
Simple merge
Simple merge
diff --cc fs/proc/root.c
Simple merge
Simple merge
Simple merge