staging: comedi: adl_pci9118: remove sanity checks in pci9118_calc_divisors()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Sep 2014 20:05:47 +0000 (13:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Sep 2014 21:34:25 +0000 (14:34 -0700)
The 'tim2' parameter to this function is actually the cmd->convert_arg which
was validated in the (*do_cmdtest) as:

err |= cfc_check_trigger_arg_min(&cmd->convert_arg,
 devprivriv->ai_ns_min);

The sanity checks in this function are just repeating that validation. The
'min_pacer' sanity check is simply not needed.

Remove these unnecessary checks.

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/adl_pci9118.c

index 95d9f2c..86c8b66 100644 (file)
@@ -520,27 +520,18 @@ static void pci9118_calc_divisors(char mode, struct comedi_device *dev,
                                  unsigned int *div1, unsigned int *div2,
                                  unsigned int chnsshfront)
 {
-       struct pci9118_private *devpriv = dev->private;
        struct comedi_cmd *cmd = &s->async->cmd;
-       unsigned int min_pacer;
 
        switch (mode) {
        case 1:
        case 4:
-               if (*tim2 < devpriv->ai_ns_min)
-                       *tim2 = devpriv->ai_ns_min;
                i8253_cascade_ns_to_timer(I8254_OSC_BASE_4MHZ,
                                          div1, div2,
                                          tim2, flags & CMDF_ROUND_NEAREST);
                break;
        case 2:
-               if (*tim2 < devpriv->ai_ns_min)
-                       *tim2 = devpriv->ai_ns_min;
                *div1 = *tim2 / I8254_OSC_BASE_4MHZ;
                                                /* convert timer (burst) */
-               min_pacer = devpriv->ai_ns_min / I8254_OSC_BASE_4MHZ;
-               if (*div1 < min_pacer)
-                       *div1 = min_pacer;
                *div2 = *tim1 / I8254_OSC_BASE_4MHZ;    /* scan timer */
                *div2 = *div2 / *div1;          /* major timer is c1*c2 */
                if (*div2 < chans)