diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-10-22 14:36:50 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-29 16:01:20 +0800 |
commit | 319ad742bddace99d6576e4b6fba1f074f29ed2a (patch) | |
tree | 13e93a0af6795fd00ed18662d9346ec3c3f8d508 /drivers/staging/comedi/comedi_buf.c | |
parent | aa26e46b0f1d2c0093ec59a68aec715df3f06715 (diff) | |
download | op-kernel-dev-319ad742bddace99d6576e4b6fba1f074f29ed2a.zip op-kernel-dev-319ad742bddace99d6576e4b6fba1f074f29ed2a.tar.gz |
staging: comedi: comedi_buf: comedi_buf_memcpy_to() remove 'offset' param
This parameter is always passed as '0'. Remove the unnecessary parameter.
This allows removing the unnecessary check of the write_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 0e4727d..c60fa1a 100644 --- a/drivers/staging/comedi/comedi_buf.c +++ b/drivers/staging/comedi/comedi_buf.c @@ -443,14 +443,10 @@ int comedi_buf_put(struct comedi_subdevice *s, unsigned short x) EXPORT_SYMBOL_GPL(comedi_buf_put); static void comedi_buf_memcpy_to(struct comedi_subdevice *s, - unsigned int offset, const void *data, unsigned int num_bytes) { struct comedi_async *async = s->async; - unsigned int write_ptr = async->buf_write_ptr + offset; - - if (write_ptr >= async->prealloc_bufsz) - write_ptr %= async->prealloc_bufsz; + unsigned int write_ptr = async->buf_write_ptr; while (num_bytes) { unsigned int block_size; @@ -526,7 +522,7 @@ unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s, return 0; } - comedi_buf_memcpy_to(s, 0, data, num_bytes); + comedi_buf_memcpy_to(s, data, num_bytes); comedi_buf_write_free(s, num_bytes); comedi_inc_scan_progress(s, num_bytes); async->events |= COMEDI_CB_BLOCK; |