[PATCH 08/18] staging: comedi: comedi_buf: absorb comedi_read_array_from_buffer()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This function is only called by comedi_buf_read_samples(). Absorb it.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/comedi_buf.c | 27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 353ccb4..4cf02cb 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -549,22 +549,6 @@ unsigned int comedi_write_array_to_buffer(struct comedi_subdevice *s,
 }
 EXPORT_SYMBOL_GPL(comedi_write_array_to_buffer);
 
-static unsigned int comedi_read_array_from_buffer(struct comedi_subdevice *s,
-						  void *data,
-						  unsigned int num_bytes)
-{
-	if (num_bytes == 0)
-		return 0;
-
-	num_bytes = comedi_buf_read_alloc(s, num_bytes);
-	comedi_buf_memcpy_from(s, 0, data, num_bytes);
-	comedi_buf_read_free(s, num_bytes);
-	comedi_inc_scan_progress(s, num_bytes);
-	s->async->events |= COMEDI_CB_BLOCK;
-
-	return num_bytes;
-}
-
 /**
  * comedi_buf_read_samples - read sample data from comedi buffer
  * @s: comedi_subdevice struct
@@ -584,6 +568,15 @@ unsigned int comedi_buf_read_samples(struct comedi_subdevice *s,
 	if (nbytes > s->async->prealloc_bufsz)
 		nbytes = s->async->prealloc_bufsz;
 
-	return comedi_read_array_from_buffer(s, data, nbytes);
+	if (nbytes == 0)
+		return 0;
+
+	nbytes = comedi_buf_read_alloc(s, nbytes);
+	comedi_buf_memcpy_from(s, 0, data, nbytes);
+	comedi_buf_read_free(s, nbytes);
+	comedi_inc_scan_progress(s, nbytes);
+	s->async->events |= COMEDI_CB_BLOCK;
+
+	return nbytes;
 }
 EXPORT_SYMBOL_GPL(comedi_buf_read_samples);
-- 
2.0.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux