From: H Hartley Sweeten Date: Tue, 13 Jan 2015 17:16:44 +0000 (-0700) Subject: staging: comedi: das1800: tidy up das1800_ai_transfer_size() X-Git-Tag: fixes-v4.0-rc1~99^2~376 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e5a21cf8e7756f668e7eb51ba99619136b79c4d;p=pandora-kernel.git staging: comedi: das1800: tidy up das1800_ai_transfer_size() For aesthetics, pass the fill time 'ns' as a parameter to this function. Refactor this function to calculate the transfer size in 'samples' instead of 'bytes'. This removes the need to constantly multiply the values by the 'sample_size'. It also helps avoid any possible integer overflow issues. Use the comedi_nsamples_left() helper to limit the samples when cmd->stop_src is TRIG_COUNT. Use comedi_samples_to_bytes() to return the final DMA size in bytes. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed