Commit d397fd58 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

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,

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: default avatarH Hartley Sweeten <>
Reviewed-by: default avatarIan Abbott <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 5fc6c95c
......@@ -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;
div1, div2,
tim2, flags & CMDF_ROUND_NEAREST);
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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment