summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2013-03-15 13:15:34 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-15 16:16:31 (GMT)
commit13f12b5aea501bce146cdf213d1819083aadc847 (patch)
tree78e645fcfcbcec587767c083faf1fae04f97364c /drivers/staging/comedi/comedi_fops.c
parenta7401cddcdf739d3cb9598c9b3787a732fc87809 (diff)
downloadlinux-fsl-qoriq-13f12b5aea501bce146cdf213d1819083aadc847.tar.xz
staging: comedi: make 'in_request_module' a bool bit-field
Change the `in_request_module` member of `struct comedi_device` to a 1-bit bit-field of type `bool` and move it into a suitable hole in the data type to save a few bytes. Change the assigned values to `true` and `false`. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index e336b28..6bcbb52 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2067,12 +2067,12 @@ static int comedi_open(struct inode *inode, struct file *file)
/* This is slightly hacky, but we want module autoloading
* to work for root.
* case: user opens device, attached -> ok
- * case: user opens device, unattached, in_request_module=0 -> autoload
- * case: user opens device, unattached, in_request_module=1 -> fail
+ * case: user opens device, unattached, !in_request_module -> autoload
+ * case: user opens device, unattached, in_request_module -> fail
* case: root opens device, attached -> ok
- * case: root opens device, unattached, in_request_module=1 -> ok
+ * case: root opens device, unattached, in_request_module -> ok
* (typically called from modprobe)
- * case: root opens device, unattached, in_request_module=0 -> autoload
+ * case: root opens device, unattached, !in_request_module -> autoload
*
* The last could be changed to "-> ok", which would deny root
* autoloading.
@@ -2088,7 +2088,7 @@ static int comedi_open(struct inode *inode, struct file *file)
if (capable(CAP_NET_ADMIN) && dev->in_request_module)
goto ok;
- dev->in_request_module = 1;
+ dev->in_request_module = true;
#ifdef CONFIG_KMOD
mutex_unlock(&dev->mutex);
@@ -2096,7 +2096,7 @@ static int comedi_open(struct inode *inode, struct file *file)
mutex_lock(&dev->mutex);
#endif
- dev->in_request_module = 0;
+ dev->in_request_module = false;
if (!dev->attached && !capable(CAP_NET_ADMIN)) {
DPRINTK("not attached and not CAP_NET_ADMIN\n");