From 5e5a21cf8e7756f668e7eb51ba99619136b79c4d Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 13 Jan 2015 10:16:44 -0700 Subject: [PATCH] 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-format-patch failed