Skip to content

Commit

Permalink
staging: comedi: s526: remove unneeded check in s526_gpct_rinsn()
Browse files Browse the repository at this point in the history
The comedi core validates insn->n before calling this function.
Remove the unnecessary check.

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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 21, 2012
1 parent 898143b commit d52f042
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/staging/comedi/drivers/s526.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@ static int s526_gpct_rinsn(struct comedi_device *dev,
unsigned short datalow;
unsigned short datahigh;

/* Check if (n > 0) */
if (insn->n <= 0) {
printk(KERN_ERR "s526: INSN_READ: n should be > 0\n");
return -EINVAL;
}
/* Read the low word first */
for (i = 0; i < insn->n; i++) {
datalow = inw(dev->iobase + REG_C0L + counter_channel * 8);
Expand Down

0 comments on commit d52f042

Please sign in to comment.