From: H Hartley Sweeten Date: Fri, 31 Oct 2014 19:04:33 +0000 (-0700) Subject: staging: comedi: adl_pci9118: use sample manipulation helpers X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1d3d32a7525bbc9c989f8c3e592dc206ee8b145a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: adl_pci9118: 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index 93b41e6712a6..2aef881b6ee4 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -586,8 +586,9 @@ static void pci9118_ai_munge(struct comedi_device *dev, unsigned int start_chan_index) { struct pci9118_private *devpriv = dev->private; - unsigned int i, num_samples = num_bytes / sizeof(short); unsigned short *array = data; + unsigned int num_samples = comedi_bytes_to_samples(s, num_bytes); + unsigned int i; for (i = 0; i < num_samples; i++) { if (devpriv->usedma)