On 20/02/15 19:52, H Hartley Sweeten wrote:
The quick exit check of (mode == MODE_SINGLE_CHAN) results in coverity
reporting a logically dead code issue in the switch code in
labpc_ai_check_chanlist().

Remove the quick exit check and allow the function to handle the
MODE_SINGLE_CHAN normally (the for loop will only happen 1 time and
the function will return 0).

Reported-by: coverity (CID 1222108)
Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
  drivers/staging/comedi/drivers/ni_labpc_common.c | 3 ---
  1 file changed, 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_labpc_common.c 
b/drivers/staging/comedi/drivers/ni_labpc_common.c
index b88ee26..084c89c 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_common.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_common.c
@@ -482,9 +482,6 @@ static int labpc_ai_check_chanlist(struct comedi_device 
*dev,
        unsigned int aref0 = CR_AREF(cmd->chanlist[0]);
        int i;

-       if (mode == MODE_SINGLE_CHAN)
-               return 0;
-
        for (i = 0; i < cmd->chanlist_len; i++) {
                unsigned int chan = CR_CHAN(cmd->chanlist[i]);
                unsigned int range = CR_RANGE(cmd->chanlist[i]);


Reviewed-by: Ian Abbott <abbo...@mev.co.uk>

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to