[PATCH 8/9] staging: comedi: hwdrv_apci3120: use sample manipulation helpers

H Hartley Sweeten hsweeten at visionengravers.com
Fri Oct 31 19:04:35 UTC 2014


Use the recently added sample manipulation helpers to remove the hardcoded
assumption of the sample size.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
index facd2c4..91707663 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
@@ -947,7 +947,9 @@ static int apci3120_cyclic_ai(int mode,
 		/* If DMA Enabled */
 		struct apci3120_dmabuf *dmabuf0 = &devpriv->dmabuf[0];
 		struct apci3120_dmabuf *dmabuf1 = &devpriv->dmabuf[1];
-		unsigned int scan_bytes = cmd->scan_end_arg * sizeof(short);
+		unsigned int scan_bytes;
+
+		scan_bytes = comedi_samples_to_bytes(s, cmd->scan_end_arg);
 
 		devpriv->b_InterruptMode = APCI3120_DMA_MODE;
 
-- 
2.0.3



More information about the devel mailing list