Skip to content

Commit

Permalink
Staging: comedi: pcl818: Remove unneeded chanlist_len check
Browse files Browse the repository at this point in the history
For AI command testing, the driver does not need to range-check the
length of the channel list as the comedi core has already checked it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 64a1f7b commit 57ac827
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions drivers/staging/comedi/drivers/pcl818.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,14 +1392,6 @@ static int ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
}
}

if (!cmd->chanlist_len) {
cmd->chanlist_len = 1;
err++;
}
if (cmd->chanlist_len > s->n_chan) {
cmd->chanlist_len = s->n_chan;
err++;
}
if (cmd->scan_end_arg != cmd->chanlist_len) {
cmd->scan_end_arg = cmd->chanlist_len;
err++;
Expand Down

0 comments on commit 57ac827

Please sign in to comment.