From: H Hartley Sweeten Date: Tue, 9 Sep 2014 20:05:47 +0000 (-0700) Subject: staging: comedi: adl_pci9118: remove sanity checks in pci9118_calc_divisors() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d397fd5886090f9462098432bd9523fd8f3df37b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: adl_pci9118: remove sanity checks in pci9118_calc_divisors() 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index 95d9f2c49961..86c8b66ba9eb 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -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)