From: Ian Abbott Date: Mon, 14 Jan 2008 17:59:31 +0000 (+0000) Subject: In comedi_do_insn, #if'ed out the final check for return value of subdevice X-Git-Tag: v0_7_76~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c956ffe5c87cca18a51555c6c152e92f9c4c1771;p=comedi.git In comedi_do_insn, #if'ed out the final check for return value of subdevice insn function matching insn.n. Comedi documentation for userspace comedi_do_insn allows a lower value to be returned and some drivers blatently do so, particularly for configuration instructions. Also added some XXX reminder comments for INSN_WAIT and INSN_CONFIG for things that need to be fixed. --- diff --git a/comedi/kcomedilib/kcomedilib_main.c b/comedi/kcomedilib/kcomedilib_main.c index f2b0330b..815fd23d 100644 --- a/comedi/kcomedilib/kcomedilib_main.c +++ b/comedi/kcomedilib/kcomedilib_main.c @@ -195,6 +195,7 @@ int comedi_do_insn(comedi_t * d, comedi_insn * insn) break; } case INSN_WAIT: + /* XXX isn't the value supposed to be nanosecs? */ if (insn->n < 1 || insn->data[0] >= 100) { ret = -EINVAL; break; @@ -270,6 +271,7 @@ int comedi_do_insn(comedi_t * d, comedi_insn * insn) ret = s->insn_bits(dev, s, insn, insn->data); break; case INSN_CONFIG: + /* XXX should check instruction length */ ret = s->insn_config(dev, s, insn, insn->data); break; default: @@ -281,11 +283,14 @@ int comedi_do_insn(comedi_t * d, comedi_insn * insn) } if (ret < 0) goto error; +#if 0 + /* XXX do we want this? -- abbotti #if'ed it out for now. */ if (ret != insn->n) { rt_printk("BUG: result of insn != insn.n\n"); ret = -EINVAL; goto error; } +#endif error: return ret;