From 58230d1cc237605d0b7e8d6700e0764405703bbd Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 19 Apr 2001 07:27:33 +0000 Subject: [PATCH] Logic error --- comedi/drivers/check_driver | 4 ++++ comedi/drivers/ni_mio_common.c | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/comedi/drivers/check_driver b/comedi/drivers/check_driver index 815b2e4d..04642156 100755 --- a/comedi/drivers/check_driver +++ b/comedi/drivers/check_driver @@ -203,3 +203,7 @@ if grep 'request_region.*dev.*iobase' ${driver} &>/dev/null;then echo "W: recommend assigning dev->iobase after successful request_region()" fi +if grep 'if.*cmd.*&&.*err..;' ${driver} &>/dev/null;then + echo "E: Probable logic error in cmdtest" +fi + diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 9335ab5b..603000f7 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -994,23 +994,23 @@ static int ni_ai_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_cmd *cmd) tmp=cmd->start_src; cmd->start_src &= TRIG_NOW; - if(!cmd->start_src && tmp!=cmd->start_src)err++; + if(!cmd->start_src || tmp!=cmd->start_src)err++; tmp=cmd->scan_begin_src; cmd->scan_begin_src &= TRIG_TIMER|TRIG_EXT; - if(!cmd->scan_begin_src && tmp!=cmd->scan_begin_src)err++; + if(!cmd->scan_begin_src || tmp!=cmd->scan_begin_src)err++; tmp=cmd->convert_src; cmd->convert_src &= TRIG_TIMER|TRIG_EXT; - if(!cmd->convert_src && tmp!=cmd->convert_src)err++; + if(!cmd->convert_src || tmp!=cmd->convert_src)err++; tmp=cmd->scan_end_src; cmd->scan_end_src &= TRIG_COUNT; - if(!cmd->scan_end_src && tmp!=cmd->scan_end_src)err++; + if(!cmd->scan_end_src || tmp!=cmd->scan_end_src)err++; tmp=cmd->stop_src; cmd->stop_src &= TRIG_COUNT|TRIG_NONE; - if(!cmd->stop_src && tmp!=cmd->stop_src)err++; + if(!cmd->stop_src || tmp!=cmd->stop_src)err++; if(err)return 1; -- 2.26.2