diff options
author | H Hartley Sweeten | 2014-10-22 23:36:51 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2014-10-29 09:01:20 +0100 |
commit | 0ca7f61cd67f7cd581bc6ba968072b4f7b0a2ef8 (patch) | |
tree | bfd72865693c67267c4dad3d30da9d37527e114b /drivers/staging/comedi/comedi_buf.c | |
parent | staging: comedi: comedi_buf: comedi_buf_memcpy_to() remove 'offset' param (diff) | |
download | kernel-qcow2-linux-0ca7f61cd67f7cd581bc6ba968072b4f7b0a2ef8.tar.gz kernel-qcow2-linux-0ca7f61cd67f7cd581bc6ba968072b4f7b0a2ef8.tar.xz kernel-qcow2-linux-0ca7f61cd67f7cd581bc6ba968072b4f7b0a2ef8.zip |
staging: comedi: comedi_buf: comedi_buf_memcpy_from() remove 'offset' param
This parameter is always passed as '0'. Remove the unnecessary parameter.
This allows removing the unnecessary check of the read_ptr overflow.
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/comedi_buf.c')
-rw-r--r-- | drivers/staging/comedi/comedi_buf.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c index c60fa1aa2048..1f916072cd93 100644 --- a/drivers/staging/comedi/comedi_buf.c +++ b/drivers/staging/comedi/comedi_buf.c @@ -466,15 +466,11 @@ static void comedi_buf_memcpy_to(struct comedi_subdevice *s, } static void comedi_buf_memcpy_from(struct comedi_subdevice *s, - unsigned int offset, void *dest, unsigned int nbytes) { void *src; struct comedi_async *async = s->async; - unsigned int read_ptr = async->buf_read_ptr + offset; - - if (read_ptr >= async->prealloc_bufsz) - read_ptr %= async->prealloc_bufsz; + unsigned int read_ptr = async->buf_read_ptr; while (nbytes) { unsigned int block_size; @@ -557,7 +553,7 @@ unsigned int comedi_buf_read_samples(struct comedi_subdevice *s, return 0; nbytes = comedi_buf_read_alloc(s, nsamples * bytes_per_sample(s)); - comedi_buf_memcpy_from(s, 0, data, nbytes); + comedi_buf_memcpy_from(s, data, nbytes); comedi_buf_read_free(s, nbytes); comedi_inc_scan_progress(s, nbytes); s->async->events |= COMEDI_CB_BLOCK; |