From 565e9cf8dcc46ed363547a1d72c13dee9bf91a2e Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sun, 8 Jul 2001 22:43:29 +0000 Subject: [PATCH] put if(cmd->chanlist) block in cmdtest --- comedi/drivers/cb_pcidas.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/comedi/drivers/cb_pcidas.c b/comedi/drivers/cb_pcidas.c index 5ebff2d2..418c37b6 100644 --- a/comedi/drivers/cb_pcidas.c +++ b/comedi/drivers/cb_pcidas.c @@ -752,19 +752,22 @@ static int cb_pcidas_ai_cmdtest(comedi_device *dev,comedi_subdevice *s, } // check channel/gain list against card's limitations - gain = CR_RANGE(cmd->chanlist[0]); - start_chan = CR_CHAN(cmd->chanlist[0]); - for(i = 1; i < cmd->chanlist_len; i++) + if(cmd->chanlist) { - if(CR_CHAN(cmd->chanlist[i]) != (start_chan + i) % s->n_chan) + gain = CR_RANGE(cmd->chanlist[0]); + start_chan = CR_CHAN(cmd->chanlist[0]); + for(i = 1; i < cmd->chanlist_len; i++) { - comedi_error(dev, "entries in chanlist must be consecutive channels, counting upwards\n"); - err++; - } - if(CR_RANGE(cmd->chanlist[i]) != gain) - { - comedi_error(dev, "entries in chanlist must all have the same gain\n"); - err++; + if(CR_CHAN(cmd->chanlist[i]) != (start_chan + i) % s->n_chan) + { + comedi_error(dev, "entries in chanlist must be consecutive channels, counting upwards\n"); + err++; + } + if(CR_RANGE(cmd->chanlist[i]) != gain) + { + comedi_error(dev, "entries in chanlist must all have the same gain\n"); + err++; + } } } -- 2.26.2