staging: comedi: amplc_pci230: 'ai_scan_count' is always 'stop_arg'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Sep 2014 23:15:44 +0000 (16:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Sep 2014 21:35:20 +0000 (14:35 -0700)
When the cmd->stop_src == TRIG_COUNT, the 'ai_scan_count' is the cmd->stop_arg.
For any other stop_src the 'ai_scan_count' is 0, which is also the cmd->stop_arg.

Simplify the 'ai_scan_count' initialization.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/amplc_pci230.c

index a0bf4600c99281317d728712abdd8b60bdb78aa1..01796cd28e5bf081f547a920f28596bb4868603d 100644 (file)
@@ -2177,11 +2177,7 @@ static int pci230_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
        if (!pci230_claim_shared(dev, res_mask, OWNER_AICMD))
                return -EBUSY;
 
-       /* Get number of scans required. */
-       if (cmd->stop_src == TRIG_COUNT)
-               devpriv->ai_scan_count = cmd->stop_arg;
-       else    /* TRIG_NONE, user calls cancel */
-               devpriv->ai_scan_count = 0;
+       devpriv->ai_scan_count = cmd->stop_arg;
        devpriv->ai_scan_pos = 0;       /* Position within scan. */
 
        /*