aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorIan Abbott <[email protected]>2019-03-19 16:54:41 +0000
committerGreg Kroah-Hartman <[email protected]>2019-03-20 08:25:17 +0100
commitfe57d1e113fcaf6af600c4d10168513c05230160 (patch)
tree4e3987ef9fa806b6e73b7e6df21c45407c951b5b /tools/perf/scripts/python/export-to-sqlite.py
parentb8585eb51e74034a7c1dd534a667400b8fd58787 (diff)
staging: comedi: ni_mio_common: Use insn->n in ni_calib_insn_write()
The `insn_write` handler for the calibration subdevice (`ni_calib_insn_write()`) currently ignores `insn->n` (the number of samples to write) and assumes a single sample is to be written, but `insn->n` could be 0, meaning no samples should be written, in which case `data[0]` is invalid. Change `ni_calib_insn_write()` to only write to the calibration device if `insn->n > 0`. There isn't much point writing all the values when `insn->n > 1`, so just write the last one (`data[insn->n - 1]`). Also follow the usual Comedi convention and return `insn->n` from the handler to indicate success (although any non-negative return value will do as far as the Comedi core is concerned). Signed-off-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions