Module: xenomai-abe
Branch: analogy
Commit: 310dd51a93b47ce29e1d4226584bfc070c93dea6
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=310dd51a93b47ce29e1d4226584bfc070c93dea6

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Tue Sep 22 00:41:23 2009 +0200

Fix some error checkings in analog output command test function

---

 .../comedi/national_instruments/mio_common.c       |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ksrc/drivers/comedi/national_instruments/mio_common.c 
b/ksrc/drivers/comedi/national_instruments/mio_common.c
index 0e40fab..fbb4d59 100644
--- a/ksrc/drivers/comedi/national_instruments/mio_common.c
+++ b/ksrc/drivers/comedi/national_instruments/mio_common.c
@@ -2987,8 +2987,6 @@ int ni_ao_cmdtest(comedi_subd_t *subd, comedi_cmd_t *cmd)
 {
        comedi_dev_t *dev = subd->dev;
 
-       int err = 0;
-
        /* Make sure trigger sources are unique and mutually compatible */
 
        if (cmd->stop_src != TRIG_COUNT && cmd->stop_src != TRIG_NONE)
@@ -2998,19 +2996,21 @@ int ni_ao_cmdtest(comedi_subd_t *subd, comedi_cmd_t 
*cmd)
 
        if (cmd->start_arg != 0) {
                cmd->start_arg = 0;
-               err++;
+               return -EINVAL;
        }
+
        if (cmd->scan_begin_src == TRIG_TIMER) {
                if (cmd->scan_begin_arg < boardtype.ao_speed) {
                        cmd->scan_begin_arg = boardtype.ao_speed;
-                       err++;
+                       return -EINVAL;
                }
                if (cmd->scan_begin_arg > devpriv->clock_ns * 0xffffff) {       
                        /* XXX check */
                        cmd->scan_begin_arg = devpriv->clock_ns * 0xffffff;
-                       err++;
+                       return -EINVAL;
                }
        }
+
        if (cmd->convert_arg != 0) {
                cmd->convert_arg = 0;
                return -EINVAL;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to