[PATCH] staging: comedi: comedidev.h: remove 'new_size' param from subdevice (*buf_change)

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

 



This parameter is never used by any of the comedi drivers that provide a
(*buf_change) callback. If the 'new_size' is needed in the callback it can
be found from the 's->async->prealloc_bufsz' as done in the ni_pcidio driver.

Remove the unused parameter.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/comedi_fops.c       |  2 +-
 drivers/staging/comedi/comedidev.h         |  3 +--
 drivers/staging/comedi/drivers.c           |  2 +-
 drivers/staging/comedi/drivers/ni_660x.c   |  3 +--
 drivers/staging/comedi/drivers/ni_pcidio.c |  2 +-
 drivers/staging/comedi/drivers/ni_pcimio.c | 15 +++++----------
 6 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 84a1e42..2182c74 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -268,7 +268,7 @@ static int resize_async_buffer(struct comedi_device *dev,
 		return retval;
 
 	if (s->buf_change) {
-		retval = s->buf_change(dev, s, new_size);
+		retval = s->buf_change(dev, s);
 		if (retval < 0)
 			return retval;
 	}
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index 6bf5616..f3999f5 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -77,8 +77,7 @@ struct comedi_subdevice {
 	int (*cancel)(struct comedi_device *, struct comedi_subdevice *);
 
 	/* called when the buffer changes */
-	int (*buf_change)(struct comedi_device *dev,
-			  struct comedi_subdevice *s, unsigned long new_size);
+	int (*buf_change)(struct comedi_device *, struct comedi_subdevice *);
 
 	void (*munge)(struct comedi_device *dev, struct comedi_subdevice *s,
 		      void *data, unsigned int num_bytes,
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 6ec4a41..42ddf13 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -320,7 +320,7 @@ static int __comedi_device_postconfig_async(struct comedi_device *dev,
 		return -ENOMEM;
 	}
 	if (s->buf_change) {
-		ret = s->buf_change(dev, s, buf_size);
+		ret = s->buf_change(dev, s);
 		if (ret < 0)
 			return ret;
 	}
diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c
index 6b8c702..20fe692 100644
--- a/drivers/staging/comedi/drivers/ni_660x.c
+++ b/drivers/staging/comedi/drivers/ni_660x.c
@@ -825,8 +825,7 @@ static int ni_660x_input_poll(struct comedi_device *dev,
 }
 
 static int ni_660x_buf_change(struct comedi_device *dev,
-			      struct comedi_subdevice *s,
-			      unsigned long new_size)
+			      struct comedi_subdevice *s)
 {
 	struct ni_660x_private *devpriv = dev->private;
 	struct ni_gpct *counter = s->private;
diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c
index 2bf8691..352c60f 100644
--- a/drivers/staging/comedi/drivers/ni_pcidio.c
+++ b/drivers/staging/comedi/drivers/ni_pcidio.c
@@ -787,7 +787,7 @@ static int ni_pcidio_cancel(struct comedi_device *dev,
 }
 
 static int ni_pcidio_change(struct comedi_device *dev,
-			    struct comedi_subdevice *s, unsigned long new_size)
+			    struct comedi_subdevice *s)
 {
 	struct nidio96_private *devpriv = dev->private;
 	int ret;
diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c
index a902a38..22c0e95 100644
--- a/drivers/staging/comedi/drivers/ni_pcimio.c
+++ b/drivers/staging/comedi/drivers/ni_pcimio.c
@@ -977,8 +977,7 @@ static const struct ni_board_struct ni_boards[] = {
 #include "ni_mio_common.c"
 
 static int pcimio_ai_change(struct comedi_device *dev,
-			    struct comedi_subdevice *s,
-			    unsigned long new_size)
+			    struct comedi_subdevice *s)
 {
 	struct ni_private *devpriv = dev->private;
 	int ret;
@@ -991,8 +990,7 @@ static int pcimio_ai_change(struct comedi_device *dev,
 }
 
 static int pcimio_ao_change(struct comedi_device *dev,
-			    struct comedi_subdevice *s,
-			    unsigned long new_size)
+			    struct comedi_subdevice *s)
 {
 	struct ni_private *devpriv = dev->private;
 	int ret;
@@ -1005,8 +1003,7 @@ static int pcimio_ao_change(struct comedi_device *dev,
 }
 
 static int pcimio_gpct0_change(struct comedi_device *dev,
-			       struct comedi_subdevice *s,
-			       unsigned long new_size)
+			       struct comedi_subdevice *s)
 {
 	struct ni_private *devpriv = dev->private;
 	int ret;
@@ -1019,8 +1016,7 @@ static int pcimio_gpct0_change(struct comedi_device *dev,
 }
 
 static int pcimio_gpct1_change(struct comedi_device *dev,
-			       struct comedi_subdevice *s,
-			       unsigned long new_size)
+			       struct comedi_subdevice *s)
 {
 	struct ni_private *devpriv = dev->private;
 	int ret;
@@ -1033,8 +1029,7 @@ static int pcimio_gpct1_change(struct comedi_device *dev,
 }
 
 static int pcimio_dio_change(struct comedi_device *dev,
-			     struct comedi_subdevice *s,
-			     unsigned long new_size)
+			     struct comedi_subdevice *s)
 {
 	struct ni_private *devpriv = dev->private;
 	int ret;
-- 
1.9.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