mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 23:26:42 +07:00
staging: comedi: fix comedi_nsamples_left.
A rounding error was causing comedi_nsamples_left to return the wrong value when nsamples was not a multiple of the scan length. Cc: <stable@vger.kernel.org> # v4.4+ Signed-off-by: Frank Mori Hess <fmh6jj@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cb57469c95
commit
a42ae59051
@ -475,8 +475,7 @@ unsigned int comedi_nsamples_left(struct comedi_subdevice *s,
|
||||
struct comedi_cmd *cmd = &async->cmd;
|
||||
|
||||
if (cmd->stop_src == TRIG_COUNT) {
|
||||
unsigned int nscans = nsamples / cmd->scan_end_arg;
|
||||
unsigned int scans_left = __comedi_nscans_left(s, nscans);
|
||||
unsigned int scans_left = __comedi_nscans_left(s, cmd->stop_arg);
|
||||
unsigned int scan_pos =
|
||||
comedi_bytes_to_samples(s, async->scan_progress);
|
||||
unsigned long long samples_left = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user