[PATCH v2 04/11] staging: comedi: comedi_buf: remove comedi_buf_alloc_strict()

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

 



This function is only called by comedi_buf_put(). Remove it and just
call __comedi_buf_write_alloc() directly with the strict flag set.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbobbi@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/comedi_buf.c | 9 +--------
 drivers/staging/comedi/comedidev.h  | 2 --
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index 56793d0..2c72dc4 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -217,13 +217,6 @@ unsigned int comedi_buf_write_alloc(struct comedi_async *async,
 }
 EXPORT_SYMBOL(comedi_buf_write_alloc);
 
-/* allocates nothing unless it can completely fulfill the request */
-unsigned int comedi_buf_write_alloc_strict(struct comedi_async *async,
-					   unsigned int nbytes)
-{
-	return __comedi_buf_write_alloc(async, nbytes, 1);
-}
-
 /* munging is applied to data by core as it passes between user
  * and kernel space */
 static unsigned int comedi_buf_munge(struct comedi_async *async,
@@ -342,7 +335,7 @@ EXPORT_SYMBOL(comedi_buf_read_free);
 
 int comedi_buf_put(struct comedi_async *async, short x)
 {
-	unsigned int n = comedi_buf_write_alloc_strict(async, sizeof(short));
+	unsigned int n = __comedi_buf_write_alloc(async, sizeof(short), 1);
 
 	if (n < sizeof(short)) {
 		async->events |= COMEDI_CB_ERROR;
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index 34a85d3..27522de 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -441,8 +441,6 @@ int comedi_buf_get(struct comedi_async *async, short *x);
 unsigned int comedi_buf_write_n_available(struct comedi_async *async);
 unsigned int comedi_buf_write_alloc(struct comedi_async *async,
 				    unsigned int nbytes);
-unsigned int comedi_buf_write_alloc_strict(struct comedi_async *async,
-					   unsigned int nbytes);
 unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes);
 unsigned comedi_buf_read_alloc(struct comedi_async *async, unsigned nbytes);
 unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes);
-- 
1.8.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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