提交 5035a96f 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: das1800: use sample manipulation helpers

Use the recently added sample manipulation helpers to remove the hardcoded
assumption of the sample size.
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: NIan Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 836b571d
...@@ -535,7 +535,7 @@ static void das1800_flush_dma_channel(struct comedi_device *dev, ...@@ -535,7 +535,7 @@ static void das1800_flush_dma_channel(struct comedi_device *dev,
/* figure out how many points to read */ /* figure out how many points to read */
num_bytes = devpriv->dma_transfer_size - get_dma_residue(channel); num_bytes = devpriv->dma_transfer_size - get_dma_residue(channel);
num_samples = num_bytes / sizeof(short); num_samples = comedi_bytes_to_samples(s, num_bytes);
/* if we only need some of the points */ /* if we only need some of the points */
if (cmd->stop_src == TRIG_COUNT && devpriv->count < num_samples) if (cmd->stop_src == TRIG_COUNT && devpriv->count < num_samples)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册