Skip to content

Commit 319ad74

Browse files
bigguinessgregkh
authored andcommitted
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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent aa26e46 commit 319ad74

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/staging/comedi/comedi_buf.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,10 @@ int comedi_buf_put(struct comedi_subdevice *s, unsigned short x)
443443
EXPORT_SYMBOL_GPL(comedi_buf_put);
444444

445445
static void comedi_buf_memcpy_to(struct comedi_subdevice *s,
446-
unsigned int offset,
447446
const void *data, unsigned int num_bytes)
448447
{
449448
struct comedi_async *async = s->async;
450-
unsigned int write_ptr = async->buf_write_ptr + offset;
451-
452-
if (write_ptr >= async->prealloc_bufsz)
453-
write_ptr %= async->prealloc_bufsz;
449+
unsigned int write_ptr = async->buf_write_ptr;
454450

455451
while (num_bytes) {
456452
unsigned int block_size;
@@ -526,7 +522,7 @@ unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
526522
return 0;
527523
}
528524

529-
comedi_buf_memcpy_to(s, 0, data, num_bytes);
525+
comedi_buf_memcpy_to(s, data, num_bytes);
530526
comedi_buf_write_free(s, num_bytes);
531527
comedi_inc_scan_progress(s, num_bytes);
532528
async->events |= COMEDI_CB_BLOCK;

0 commit comments

Comments
 (0)