diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-10-31 22:04:31 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-04 03:34:17 +0300 |
commit | bd508fffda8fc3dbcabab9bc31817c588f7938c2 (patch) | |
tree | 5a5f67df6014f2c57c1d63ffc949a5fdd06851e4 /drivers | |
parent | 5035a96f3640ee4705f69287726bfcc598212717 (diff) | |
download | linux-bd508fffda8fc3dbcabab9bc31817c588f7938c2.tar.xz |
staging: comedi: das16: use sample manipulation helpers
Use the recently added sample manipulation helpers to remove the hardcoded
assumption of the sample size.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/drivers/das16.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index 26f54aa9d41c..8de27053666f 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -863,8 +863,9 @@ static void das16_ai_munge(struct comedi_device *dev, unsigned int num_bytes, unsigned int start_chan_index) { - unsigned int i, num_samples = num_bytes / sizeof(short); unsigned short *data = array; + unsigned int num_samples = comedi_bytes_to_samples(s, num_bytes); + unsigned int i; for (i = 0; i < num_samples; i++) { data[i] = le16_to_cpu(data[i]); |