diff options
| author | Ian Abbott <[email protected]> | 2019-03-27 15:15:15 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2019-03-29 17:10:18 +0100 |
| commit | 5c724e197eb57336696a0a573b199a273db9466b (patch) | |
| tree | f7f1fc27d9b33bd1ba8004e62869a9f0aca62ec6 /tools/perf/scripts/python/bin | |
| parent | 81a6e1cc312ea43b4a23e6f371dda1bd233ea750 (diff) | |
staging: comedi: ni_tio: Use data[insn->n-1] in ni_tio_insn_write()
The `insn_write` handler for the counter subdevices
(`ni_tio_insn_write()`) writes a single data value `data[0]` to the
channel. Technically, `insn->n` specifies the number of successive
values from `data[]` to write to the channel, but when there is little
benefit in writing multiple data values, the usual Comedi convention is
to just write the last data value `data[insn->n - 1]`. Change the
function to follow that convention and use `data[insn->n - 1]` instead
of `data[0]`. (In practice, `insn->n` would normally be 1 anyway.)
Also follow the usual Comedi convention and return `insn->n` from the
handler to indicate success instead of 0 (although any non-negative
return value will do).
Signed-off-by: Ian Abbott <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions