summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorH Hartley Sweeten2014-07-18 23:28:14 +0200
committerGreg Kroah-Hartman2014-07-19 01:10:40 +0200
commit36efbacdcb25427fda00d9af5c22a4f3a8867632 (patch)
treede1dc76847a917b5f58d8a1ad8f8baa91fc7d74d /drivers/staging/comedi/comedi_fops.c
parentstaging: comedi: comedi.h: checkpatch.pl --strict cleanup (diff)
downloadkernel-qcow2-linux-36efbacdcb25427fda00d9af5c22a4f3a8867632.tar.gz
kernel-qcow2-linux-36efbacdcb25427fda00d9af5c22a4f3a8867632.tar.xz
kernel-qcow2-linux-36efbacdcb25427fda00d9af5c22a4f3a8867632.zip
staging: comedi: comedi_fops: checkpatch.pl --strict cleanup
Fix the checkpatch.pl --strict issues: CHECK: braces {} should be used on all arms of this statement CHECK: Alignment should match open parenthesis CHECK: Prefer kzalloc(sizeof(*dev)...) over kzalloc(sizeof(struct comedi_device)...) Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: 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, 5 insertions, 7 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 175003125784..01fb31d7f3cd 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1227,10 +1227,9 @@ static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn,
/* Most drivers ignore the base channel in
* insn->chanspec. Fix this here if
* the subdevice has <= 32 channels. */
- unsigned int shift;
- unsigned int orig_mask;
+ unsigned int orig_mask = data[0];
+ unsigned int shift = 0;
- orig_mask = data[0];
if (s->n_chan <= 32) {
shift = CR_CHAN(insn->chanspec);
if (shift > 0) {
@@ -1238,8 +1237,7 @@ static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn,
data[0] <<= shift;
data[1] <<= shift;
}
- } else
- shift = 0;
+ }
ret = s->insn_bits(dev, s, insn, data);
data[0] = orig_mask;
if (shift > 0)
@@ -2178,7 +2176,7 @@ out:
}
static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
- loff_t *offset)
+ loff_t *offset)
{
struct comedi_subdevice *s;
struct comedi_async *async;
@@ -2443,7 +2441,7 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device)
struct device *csdev;
unsigned i;
- dev = kzalloc(sizeof(struct comedi_device), GFP_KERNEL);
+ dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (dev == NULL)
return ERR_PTR(-ENOMEM);
comedi_device_init(dev);