]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
staging: comedi: cb_pcidas: trigger sources are validated in (*do_cmdtest)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 10 Feb 2014 22:20:33 +0000 (15:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2014 17:31:30 +0000 (09:31 -0800)
The trigger sources were already validataed in the (*do_cmdtest) before the
(*do_cmd) is called. Refactor the code in cb_pcidas_ai_cmd() to remove the
final else which can never be reached.

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

index 7d068ebe05759eac6ada2bb041183f84d391e53f..5452b718f93f43a1ca300c460651837929f69f01 100644 (file)
@@ -1017,9 +1017,9 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
 
        /*  set start trigger and burst mode */
        bits = 0;
-       if (cmd->start_src == TRIG_NOW)
+       if (cmd->start_src == TRIG_NOW) {
                bits |= SW_TRIGGER;
-       else if (cmd->start_src == TRIG_EXT) {
+       } else {        /* TRIG_EXT */
                bits |= EXT_TRIGGER | TGEN | XTRCL;
                if (thisboard->is_1602) {
                        if (cmd->start_arg & CR_INVERT)
@@ -1027,9 +1027,6 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
                        if (cmd->start_arg & CR_EDGE)
                                bits |= TGSEL;
                }
-       } else {
-               comedi_error(dev, "bug!");
-               return -1;
        }
        if (cmd->convert_src == TRIG_NOW && cmd->chanlist_len > 1)
                bits |= BURSTE;