diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-05-27 17:30:52 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-28 21:28:53 (GMT) |
commit | 45c9db919127bccdecb8105ee393e58c27040061 (patch) | |
tree | 14ca327da29d43c30544db4c798c50e3304369c4 /drivers/staging/comedi | |
parent | d1462b9430d8c7e2e17c807116f2e24b3a81cd87 (diff) | |
download | linux-45c9db919127bccdecb8105ee393e58c27040061.tar.xz |
staging: comedi: mite: tidy up local variables in mite_sync_output_dma()
Tidy up the local variables so that the comedi_cmd is accessed as a pointer
instead of getting to it from the comedi_async pointer.
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/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/mite.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c index c12806e..19c029a 100644 --- a/drivers/staging/comedi/drivers/mite.c +++ b/drivers/staging/comedi/drivers/mite.c @@ -562,21 +562,19 @@ int mite_sync_output_dma(struct mite_channel *mite_chan, struct comedi_subdevice *s) { struct comedi_async *async = s->async; - int count; + struct comedi_cmd *cmd = &async->cmd; + u32 stop_count = cmd->stop_arg * cfc_bytes_per_scan(s); + unsigned int old_alloc_count = async->buf_read_alloc_count; u32 nbytes_ub, nbytes_lb; - unsigned int old_alloc_count; - u32 stop_count = async->cmd.stop_arg * cfc_bytes_per_scan(s); + int count; - old_alloc_count = async->buf_read_alloc_count; /* read alloc as much as we can */ comedi_buf_read_alloc(s, async->prealloc_bufsz); nbytes_lb = mite_bytes_read_from_memory_lb(mite_chan); - if (async->cmd.stop_src == TRIG_COUNT && - (int)(nbytes_lb - stop_count) > 0) + if (cmd->stop_src == TRIG_COUNT && (int)(nbytes_lb - stop_count) > 0) nbytes_lb = stop_count; nbytes_ub = mite_bytes_read_from_memory_ub(mite_chan); - if (async->cmd.stop_src == TRIG_COUNT && - (int)(nbytes_ub - stop_count) > 0) + if (cmd->stop_src == TRIG_COUNT && (int)(nbytes_ub - stop_count) > 0) nbytes_ub = stop_count; if ((int)(nbytes_ub - old_alloc_count) > 0) { dev_warn(s->device->class_dev, "mite: DMA underrun\n"); |