提交 d21c95c5 编写于 作者: J Jonathan Corbet

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: NJonathan Corbet <corbet@lwn.net>
上级 39d95b9d
......@@ -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)
{
......
......@@ -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);
......
......@@ -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);
......
......@@ -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");
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -1812,6 +1812,7 @@ static int find_shared_port(struct file *fp,
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() */
......
......@@ -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)
{
/*
......
......@@ -862,6 +862,8 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
} /* 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;
......
......@@ -1027,6 +1027,8 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
} /* 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;
......
......@@ -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)
......
......@@ -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)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册