staging: comedi: usbdux: remove unnecessary check in usbdux_ai_cmd()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 25 Jul 2013 23:10:43 +0000 (16:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2013 22:10:08 +0000 (15:10 -0700)
This check is not necessary. The cmd->chanlist_len will always be
less than or equal to the subdevice len_chanlist that was setup
during the attach of the device.

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

index cb94964cc9baef91f8f1f72d6f95365cbad5c292..3fc61d134acb51deb40444cc860f0d30cc6649bf 100644 (file)
@@ -110,9 +110,6 @@ sampling rate. If you sample two channels you get 4kHz and so on.
 /* Default PWM frequency */
 #define PWM_DEFAULT_PERIOD ((long)(1E9/100))
 
-/* Number of channels */
-#define NUMCHANNELS       8
-
 /* Size of one A/D value */
 #define SIZEADIN          ((sizeof(int16_t)))
 
@@ -784,9 +781,6 @@ static int usbdux_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
                unsigned int chan = CR_CHAN(cmd->chanlist[i]);
                unsigned int range = CR_RANGE(cmd->chanlist[i]);
 
-               if (i >= NUMCHANNELS)
-                       break;
-
                devpriv->dux_commands[i + 2] = create_adc_command(chan, range);
        }