diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-16 15:40:30 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 16:05:50 -0400 |
commit | d21c95c569c462da20d491b75d0a45bd70ddc1bf (patch) | |
tree | c5efcd4a1ae50101a56abc1f5a27ef5173da209d | |
parent | 39d95b9d857ad9ed335dd1a2d6c6de1f1ee69ce1 (diff) |
Add "no BKL needed" comments to several drivers
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>
-rw-r--r-- | arch/cris/arch-v10/drivers/eeprom.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/cryptocop.c | 2 | ||||
-rw-r--r-- | drivers/char/cs5535_gpio.c | 2 | ||||
-rw-r--r-- | drivers/char/dtlk.c | 2 | ||||
-rw-r--r-- | drivers/char/pc8736x_gpio.c | 1 | ||||
-rw-r--r-- | drivers/char/ppdev.c | 1 | ||||
-rw-r--r-- | drivers/char/scx200_gpio.c | 1 | ||||
-rw-r--r-- | drivers/char/tb0219.c | 1 | ||||
-rw-r--r-- | drivers/char/vr41xx_giu.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/core/ucm.c | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_file_ops.c | 1 | ||||
-rw-r--r-- | drivers/net/ppp_generic.c | 1 | ||||
-rw-r--r-- | drivers/scsi/3w-9xxx.c | 2 | ||||
-rw-r--r-- | drivers/scsi/3w-xxxx.c | 2 | ||||
-rw-r--r-- | drivers/scsi/megaraid.c | 5 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.c | 1 |
16 files changed, 23 insertions, 4 deletions
diff --git a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c index f1cac9dc75b8..40c6fe4c06f4 100644 --- a/arch/cris/arch-v10/drivers/eeprom.c +++ b/arch/cris/arch-v10/drivers/eeprom.c | |||
@@ -375,7 +375,7 @@ int __init eeprom_init(void) | |||
375 | } | 375 | } |
376 | 376 | ||
377 | /* Opens the device. */ | 377 | /* Opens the device. */ |
378 | 378 | /* BKL not needed: no global resources accessed */ | |
379 | static int eeprom_open(struct inode * inode, struct file * file) | 379 | static int eeprom_open(struct inode * inode, struct file * file) |
380 | { | 380 | { |
381 | 381 | ||
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index 9fb58202be99..c17204289575 100644 --- a/arch/cris/arch-v32/drivers/cryptocop.c +++ b/arch/cris/arch-v32/drivers/cryptocop.c | |||
@@ -2302,7 +2302,7 @@ static int cryptocop_job_setup(struct cryptocop_prio_job **pj, struct cryptocop_ | |||
2302 | return 0; | 2302 | return 0; |
2303 | } | 2303 | } |
2304 | 2304 | ||
2305 | 2305 | /* No BKL needed here - no global resources accessed */ | |
2306 | static int cryptocop_open(struct inode *inode, struct file *filp) | 2306 | static int cryptocop_open(struct inode *inode, struct file *filp) |
2307 | { | 2307 | { |
2308 | int p = iminor(inode); | 2308 | int p = iminor(inode); |
diff --git a/drivers/char/cs5535_gpio.c b/drivers/char/cs5535_gpio.c index c0a4a0bb509e..628e3d3249d2 100644 --- a/drivers/char/cs5535_gpio.c +++ b/drivers/char/cs5535_gpio.c | |||
@@ -153,6 +153,8 @@ static ssize_t cs5535_gpio_read(struct file *file, char __user *buf, | |||
153 | return count; | 153 | return count; |
154 | } | 154 | } |
155 | 155 | ||
156 | /* No BKL needed here - "mask" is the only global resource used | ||
157 | here and it's a boot-time parameter */ | ||
156 | static int cs5535_gpio_open(struct inode *inode, struct file *file) | 158 | static int cs5535_gpio_open(struct inode *inode, struct file *file) |
157 | { | 159 | { |
158 | u32 m = iminor(inode); | 160 | u32 m = iminor(inode); |
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index abde6ddefe69..433388c60235 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c | |||
@@ -288,6 +288,8 @@ static int dtlk_ioctl(struct inode *inode, | |||
288 | } | 288 | } |
289 | } | 289 | } |
290 | 290 | ||
291 | /* No BKL needed here; "dtlk_busy" is the only global resource, | ||
292 | and it is not ever set by anybody (test is broken) */ | ||
291 | static int dtlk_open(struct inode *inode, struct file *file) | 293 | static int dtlk_open(struct inode *inode, struct file *file) |
292 | { | 294 | { |
293 | TRACE_TEXT("(dtlk_open"); | 295 | TRACE_TEXT("(dtlk_open"); |
diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c index ecfaf180e5bd..8715dc9f4a53 100644 --- a/drivers/char/pc8736x_gpio.c +++ b/drivers/char/pc8736x_gpio.c | |||
@@ -212,6 +212,7 @@ static struct nsc_gpio_ops pc8736x_gpio_ops = { | |||
212 | .gpio_current = pc8736x_gpio_current | 212 | .gpio_current = pc8736x_gpio_current |
213 | }; | 213 | }; |
214 | 214 | ||
215 | /* No BKL needed here; no global resources accessed */ | ||
215 | static int pc8736x_gpio_open(struct inode *inode, struct file *file) | 216 | static int pc8736x_gpio_open(struct inode *inode, struct file *file) |
216 | { | 217 | { |
217 | unsigned m = iminor(inode); | 218 | unsigned m = iminor(inode); |
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 3aab837d9480..ce1987574888 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c | |||
@@ -633,6 +633,7 @@ static int pp_ioctl(struct inode *inode, struct file *file, | |||
633 | return 0; | 633 | return 0; |
634 | } | 634 | } |
635 | 635 | ||
636 | /* No BKL needed here: only local resources used */ | ||
636 | static int pp_open (struct inode * inode, struct file * file) | 637 | static int pp_open (struct inode * inode, struct file * file) |
637 | { | 638 | { |
638 | unsigned int minor = iminor(inode); | 639 | unsigned int minor = iminor(inode); |
diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c index 99e5272e3c53..be2c623a9862 100644 --- a/drivers/char/scx200_gpio.c +++ b/drivers/char/scx200_gpio.c | |||
@@ -46,6 +46,7 @@ struct nsc_gpio_ops scx200_gpio_ops = { | |||
46 | }; | 46 | }; |
47 | EXPORT_SYMBOL_GPL(scx200_gpio_ops); | 47 | EXPORT_SYMBOL_GPL(scx200_gpio_ops); |
48 | 48 | ||
49 | /* No BKL needed here: no global resources used */ | ||
49 | static int scx200_gpio_open(struct inode *inode, struct file *file) | 50 | static int scx200_gpio_open(struct inode *inode, struct file *file) |
50 | { | 51 | { |
51 | unsigned m = iminor(inode); | 52 | unsigned m = iminor(inode); |
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c index 4c431cb7cf1b..db8c2ca2ce4c 100644 --- a/drivers/char/tb0219.c +++ b/drivers/char/tb0219.c | |||
@@ -232,6 +232,7 @@ static ssize_t tanbac_tb0219_write(struct file *file, const char __user *data, | |||
232 | return i; | 232 | return i; |
233 | } | 233 | } |
234 | 234 | ||
235 | /* No BKL needed here; no global resources accessed */ | ||
235 | static int tanbac_tb0219_open(struct inode *inode, struct file *file) | 236 | static int tanbac_tb0219_open(struct inode *inode, struct file *file) |
236 | { | 237 | { |
237 | unsigned int minor; | 238 | unsigned int minor; |
diff --git a/drivers/char/vr41xx_giu.c b/drivers/char/vr41xx_giu.c index e5ed09192be8..412937fdb958 100644 --- a/drivers/char/vr41xx_giu.c +++ b/drivers/char/vr41xx_giu.c | |||
@@ -543,6 +543,8 @@ static ssize_t gpio_write(struct file *file, const char __user *data, | |||
543 | return i; | 543 | return i; |
544 | } | 544 | } |
545 | 545 | ||
546 | /* No BKL needed here; only global (giu_nr_pins) is only set | ||
547 | at probe time */ | ||
546 | static int gpio_open(struct inode *inode, struct file *file) | 548 | static int gpio_open(struct inode *inode, struct file *file) |
547 | { | 549 | { |
548 | unsigned int pin; | 550 | unsigned int pin; |
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c index d7a6881b571d..3e6a8ff6d76c 100644 --- a/drivers/infiniband/core/ucm.c +++ b/drivers/infiniband/core/ucm.c | |||
@@ -1155,6 +1155,7 @@ static unsigned int ib_ucm_poll(struct file *filp, | |||
1155 | return mask; | 1155 | return mask; |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | /* No BKL needed here: no global resources used */ | ||
1158 | static int ib_ucm_open(struct inode *inode, struct file *filp) | 1159 | static int ib_ucm_open(struct inode *inode, struct file *filp) |
1159 | { | 1160 | { |
1160 | struct ib_ucm_file *file; | 1161 | struct ib_ucm_file *file; |
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c index b472b15637f0..e80cfbd4f3fd 100644 --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c | |||
@@ -1812,6 +1812,7 @@ done: | |||
1812 | return ret; | 1812 | return ret; |
1813 | } | 1813 | } |
1814 | 1814 | ||
1815 | /* No BKL needed here */ | ||
1815 | static int ipath_open(struct inode *in, struct file *fp) | 1816 | static int ipath_open(struct inode *in, struct file *fp) |
1816 | { | 1817 | { |
1817 | /* The real work is performed later in ipath_assign_port() */ | 1818 | /* The real work is performed later in ipath_assign_port() */ |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 1f4ca2b54a73..dc8505062da7 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -351,6 +351,7 @@ static const int npindex_to_ethertype[NUM_NP] = { | |||
351 | * Open instances of /dev/ppp can be in one of three states: | 351 | * Open instances of /dev/ppp can be in one of three states: |
352 | * unattached, attached to a ppp unit, or attached to a ppp channel. | 352 | * unattached, attached to a ppp unit, or attached to a ppp channel. |
353 | */ | 353 | */ |
354 | /* No BKL needed here */ | ||
354 | static int ppp_open(struct inode *inode, struct file *file) | 355 | static int ppp_open(struct inode *inode, struct file *file) |
355 | { | 356 | { |
356 | /* | 357 | /* |
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index b31faeccb9cd..2239d16fb9b5 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c | |||
@@ -862,6 +862,8 @@ out: | |||
862 | } /* End twa_chrdev_ioctl() */ | 862 | } /* End twa_chrdev_ioctl() */ |
863 | 863 | ||
864 | /* This function handles open for the character device */ | 864 | /* This function handles open for the character device */ |
865 | /* NOTE that this function will race with remove; adding BKL | ||
866 | will not help. */ | ||
865 | static int twa_chrdev_open(struct inode *inode, struct file *file) | 867 | static int twa_chrdev_open(struct inode *inode, struct file *file) |
866 | { | 868 | { |
867 | unsigned int minor_number; | 869 | unsigned int minor_number; |
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index 8c22329aa85e..bbff029536ea 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c | |||
@@ -1027,6 +1027,8 @@ out: | |||
1027 | } /* End tw_chrdev_ioctl() */ | 1027 | } /* End tw_chrdev_ioctl() */ |
1028 | 1028 | ||
1029 | /* This function handles open for the character device */ | 1029 | /* This function handles open for the character device */ |
1030 | /* NOTE that this function races with remove - adding BKL | ||
1031 | won't help */ | ||
1030 | static int tw_chrdev_open(struct inode *inode, struct file *file) | 1032 | static int tw_chrdev_open(struct inode *inode, struct file *file) |
1031 | { | 1033 | { |
1032 | unsigned int minor_number; | 1034 | unsigned int minor_number; |
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 18551aaf5e09..c9aa2c45a699 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c | |||
@@ -3272,8 +3272,9 @@ mega_init_scb(adapter_t *adapter) | |||
3272 | * @filep - unused | 3272 | * @filep - unused |
3273 | * | 3273 | * |
3274 | * Routines for the character/ioctl interface to the driver. Find out if this | 3274 | * Routines for the character/ioctl interface to the driver. Find out if this |
3275 | * is a valid open. If yes, increment the module use count so that it cannot | 3275 | * is a valid open. |
3276 | * be unloaded. | 3276 | * |
3277 | * No BKL needed here. | ||
3277 | */ | 3278 | */ |
3278 | static int | 3279 | static int |
3279 | megadev_open (struct inode *inode, struct file *filep) | 3280 | megadev_open (struct inode *inode, struct file *filep) |
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 7d84c8bbcf3f..81374b7c555c 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -2860,6 +2860,7 @@ static void megasas_shutdown(struct pci_dev *pdev) | |||
2860 | 2860 | ||
2861 | /** | 2861 | /** |
2862 | * megasas_mgmt_open - char node "open" entry point | 2862 | * megasas_mgmt_open - char node "open" entry point |
2863 | * No BKL is needed here. | ||
2863 | */ | 2864 | */ |
2864 | static int megasas_mgmt_open(struct inode *inode, struct file *filep) | 2865 | static int megasas_mgmt_open(struct inode *inode, struct file *filep) |
2865 | { | 2866 | { |