From: Ian Abbott Date: Thu, 23 Oct 2014 12:47:51 +0000 (+0100) Subject: staging: comedi: introduce some sample size manipulation functions X-Git-Tag: omap-for-v3.19/fixes-rc1~73^2~720 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf33eb4b4f57d277eac611b5d331976059bcc700;p=pandora-kernel.git staging: comedi: introduce some sample size manipulation functions Introduce a few static inline helper functions: `comedi_bytes_per_sample(s)` is the same as the existing `bytes_per_sample(s)` and determines the size of a comedi sample in bytes. (`bytes_per_sample(s)` will be removed.) `comedi_sample_shift(s)` determines the log2 of the comedi sample size, so it can be used in bit-shift operations to multiply or divide by the sample size. `comedi_bytes_to_samples(s, nbytes)` converts a number of bytes to a number of samples (rounding down). `comedi_samples_to_bytes(s, nsamples)` converts a number of samples to a number of bytes. Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed