]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Add "no BKL needed" comments to several drivers
authorJonathan Corbet <corbet@lwn.net>
Fri, 16 May 2008 19:40:30 +0000 (13:40 -0600)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:50 +0000 (14:05 -0600)
This documents the fact that somebody looked at the relevant open()
functions and concluded that, due to their trivial nature, no locking was
needed.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
16 files changed:
arch/cris/arch-v10/drivers/eeprom.c
arch/cris/arch-v32/drivers/cryptocop.c
drivers/char/cs5535_gpio.c
drivers/char/dtlk.c
drivers/char/pc8736x_gpio.c
drivers/char/ppdev.c
drivers/char/scx200_gpio.c
drivers/char/tb0219.c
drivers/char/vr41xx_giu.c
drivers/infiniband/core/ucm.c
drivers/infiniband/hw/ipath/ipath_file_ops.c
drivers/net/ppp_generic.c
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-xxxx.c
drivers/scsi/megaraid.c
drivers/scsi/megaraid/megaraid_sas.c

index f1cac9dc75b8150bfdad17e904450f7738428438..40c6fe4c06f4a010a7fd4a264d36f2d4ac3cf5c9 100644 (file)
@@ -375,7 +375,7 @@ int __init eeprom_init(void)
 }
 
 /* Opens the device. */
-
+/* BKL not needed: no global resources accessed */
 static int eeprom_open(struct inode * inode, struct file * file)
 {
 
index 9fb58202be99b8d54d729c161dba9983cc29352d..c17204289575865513974b9e41fdea1730981a70 100644 (file)
@@ -2302,7 +2302,7 @@ static int cryptocop_job_setup(struct cryptocop_prio_job **pj, struct cryptocop_
        return 0;
 }
 
-
+/* No BKL needed here - no global resources accessed */
 static int cryptocop_open(struct inode *inode, struct file *filp)
 {
        int p = iminor(inode);
index c0a4a0bb509e77397875b023bc4ad4f1324946bf..628e3d3249d216fed6842af53c514514989ff84f 100644 (file)
@@ -153,6 +153,8 @@ static ssize_t cs5535_gpio_read(struct file *file, char __user *buf,
        return count;
 }
 
+/* No BKL needed here - "mask" is the only global resource used
+   here and it's a boot-time parameter */
 static int cs5535_gpio_open(struct inode *inode, struct file *file)
 {
        u32 m = iminor(inode);
index abde6ddefe696e7e0af352e918085c68a83f4d89..433388c6023565fdb0f7dffe6587e86b172ecc17 100644 (file)
@@ -288,6 +288,8 @@ static int dtlk_ioctl(struct inode *inode,
        }
 }
 
+/* No BKL needed here; "dtlk_busy" is the only global resource,
+   and it is not ever set by anybody (test is broken) */
 static int dtlk_open(struct inode *inode, struct file *file)
 {
        TRACE_TEXT("(dtlk_open");
index ecfaf180e5bd8b106ee12e06da33fc0c1a88f702..8715dc9f4a531f2f64445642970e6c603f04ba82 100644 (file)
@@ -212,6 +212,7 @@ static struct nsc_gpio_ops pc8736x_gpio_ops = {
        .gpio_current   = pc8736x_gpio_current
 };
 
+/* No BKL needed here; no global resources accessed */
 static int pc8736x_gpio_open(struct inode *inode, struct file *file)
 {
        unsigned m = iminor(inode);
index 3aab837d9480ae57e66fb9f438e76efd263fea95..ce1987574888370c86b5076e51905dfe5b6bfa6f 100644 (file)
@@ -633,6 +633,7 @@ static int pp_ioctl(struct inode *inode, struct file *file,
        return 0;
 }
 
+/* No BKL needed here: only local resources used */
 static int pp_open (struct inode * inode, struct file * file)
 {
        unsigned int minor = iminor(inode);
index 99e5272e3c53e1ef1aa32f0733b1bbf0e9f2487e..be2c623a9862f6cfa80cfe0170acc3ce15e3161c 100644 (file)
@@ -46,6 +46,7 @@ struct nsc_gpio_ops scx200_gpio_ops = {
 };
 EXPORT_SYMBOL_GPL(scx200_gpio_ops);
 
+/* No BKL needed here: no global resources used */
 static int scx200_gpio_open(struct inode *inode, struct file *file)
 {
        unsigned m = iminor(inode);
index 4c431cb7cf1b1f21f1c32389d738c005c0df7a9d..db8c2ca2ce4cf2b3d2c0f5e824abc08cda220ed6 100644 (file)
@@ -232,6 +232,7 @@ static ssize_t tanbac_tb0219_write(struct file *file, const char __user *data,
        return i;
 }
 
+/* No BKL needed here; no global resources accessed */
 static int tanbac_tb0219_open(struct inode *inode, struct file *file)
 {
        unsigned int minor;
index e5ed09192be8675b615f6978dcf92f41a3dcf316..412937fdb958da364bba8cbe5686a16527b1d8de 100644 (file)
@@ -543,6 +543,8 @@ static ssize_t gpio_write(struct file *file, const char __user *data,
        return i;
 }
 
+/* No BKL needed here; only global (giu_nr_pins) is only set
+   at probe time */
 static int gpio_open(struct inode *inode, struct file *file)
 {
        unsigned int pin;
index d7a6881b571d990ec1fd47ba959126ac68a64b7e..3e6a8ff6d76cbc47019160a58a17e1e023f3ff26 100644 (file)
@@ -1155,6 +1155,7 @@ static unsigned int ib_ucm_poll(struct file *filp,
        return mask;
 }
 
+/* No BKL needed here: no global resources used */
 static int ib_ucm_open(struct inode *inode, struct file *filp)
 {
        struct ib_ucm_file *file;
index b472b15637f003da8b1a980a2d62206fb9c51eb3..e80cfbd4f3fd2d2536282a4d5e258ff8482b7155 100644 (file)
@@ -1812,6 +1812,7 @@ done:
        return ret;
 }
 
+/* No BKL needed here */
 static int ipath_open(struct inode *in, struct file *fp)
 {
        /* The real work is performed later in ipath_assign_port() */
index 1f4ca2b54a73370213d1ce162c5c048e00bfc732..dc8505062da7252d397787015c46c7f7d3e22805 100644 (file)
@@ -351,6 +351,7 @@ static const int npindex_to_ethertype[NUM_NP] = {
  * Open instances of /dev/ppp can be in one of three states:
  * unattached, attached to a ppp unit, or attached to a ppp channel.
  */
+/* No BKL needed here */
 static int ppp_open(struct inode *inode, struct file *file)
 {
        /*
index b31faeccb9cde4f0e15a762e38c777ba6a2ea976..2239d16fb9b568225df0fa5e0e26eaec4a2be5f7 100644 (file)
@@ -862,6 +862,8 @@ out:
 } /* End twa_chrdev_ioctl() */
 
 /* This function handles open for the character device */
+/* NOTE that this function will race with remove; adding BKL
+   will not help. */
 static int twa_chrdev_open(struct inode *inode, struct file *file)
 {
        unsigned int minor_number;
index 8c22329aa85e1585035127185c0597cb51a95827..bbff029536ea3dda3dfdd39f4f20734ded7b91c4 100644 (file)
@@ -1027,6 +1027,8 @@ out:
 } /* End tw_chrdev_ioctl() */
 
 /* This function handles open for the character device */
+/* NOTE that this function races with remove - adding BKL
+   won't help */
 static int tw_chrdev_open(struct inode *inode, struct file *file)
 {
        unsigned int minor_number;
index 18551aaf5e094e07612ddf028df0dc7f2a05d344..c9aa2c45a6992dc2ec65e5b86b6d8d3f7c9f0031 100644 (file)
@@ -3272,8 +3272,9 @@ mega_init_scb(adapter_t *adapter)
  * @filep - unused
  *
  * Routines for the character/ioctl interface to the driver. Find out if this
- * is a valid open. If yes, increment the module use count so that it cannot
- * be unloaded.
+ * is a valid open. 
+ *
+ * No BKL needed here.
  */
 static int
 megadev_open (struct inode *inode, struct file *filep)
index 7d84c8bbcf3fc1a55b8a9c04cbc65e2e05b33902..81374b7c555ce926a4be6321b0b95ec29eb39d4e 100644 (file)
@@ -2860,6 +2860,7 @@ static void megasas_shutdown(struct pci_dev *pdev)
 
 /**
  * megasas_mgmt_open - char node "open" entry point
+ * No BKL is needed here.
  */
 static int megasas_mgmt_open(struct inode *inode, struct file *filep)
 {