aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorIan Abbott <[email protected]>2015-10-27 16:59:15 +0000
committerGreg Kroah-Hartman <[email protected]>2015-10-29 08:58:36 +0900
commit8fa8a260d22b5a6da088afb12e3321a35f397104 (patch)
tree9624b0cd48a840f56bfc8409d218e7ce72316549 /tools/perf/scripts/python
parent783ddaebd3978cb9a1c6899899b2208a96d2b9f0 (diff)
staging: comedi: comedi_test: move modulo operations for waveform
The fake waveform generator functions, `fake_sawtooth()` and `fake_squarewave()`, called from `fake_waveform()`, have a `current_time` parameter which is the time since the start of a waveform period. The parameter value may be greater than the waveform period so they do a modulo operation to bring it into range. Do the modulo operations outside the functions in `waveform_ai_interrupt()` so that the waveform generator functions always get a `current_time` parameter less than the waveform period and do not have to do the modulo operation themselves. Also, only do the modulo operations when the time since the start of a waveform exceeds the waveform period. Usually, several samples are produced in each waveform period and modulo operations are typically more expensive than a simple comparison. Signed-off-by: Ian Abbott <[email protected]> Reviewed-by: H Hartley Sweeten <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions