From: H Hartley Sweeten Date: Fri, 31 Oct 2014 19:04:35 +0000 (-0700) Subject: staging: comedi: hwdrv_apci3120: use sample manipulation helpers X-Git-Tag: firefly_0821_release~176^2~2665^2~452 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=14f7b68058184910794a9f54898e8228855f50f0;p=firefly-linux-kernel-4.4.55.git staging: comedi: hwdrv_apci3120: 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/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c index facd2c4b922d..917076632433 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;