From bf33eb4b4f57d277eac611b5d331976059bcc700 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 23 Oct 2014 13:47:51 +0100 Subject: [PATCH] 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-format-patch failed