Commit 482f0a21 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: remove async parameter from resize_async_buffer()

The `struct comedi_async *async` parameter of `resize_async_buffer()` is
redundant as its value can be easily derived from the `struct
comedi_subdevice *s` parameter as `s->async`.  Remove the parameter.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0ce016d0
...@@ -238,9 +238,9 @@ comedi_write_subdevice(const struct comedi_device *dev, unsigned int minor) ...@@ -238,9 +238,9 @@ comedi_write_subdevice(const struct comedi_device *dev, unsigned int minor)
} }
static int resize_async_buffer(struct comedi_device *dev, static int resize_async_buffer(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s, unsigned new_size)
struct comedi_async *async, unsigned new_size)
{ {
struct comedi_async *async = s->async;
int retval; int retval;
if (new_size > async->max_bufsize) if (new_size > async->max_bufsize)
...@@ -380,7 +380,7 @@ static ssize_t read_buffer_kb_store(struct device *csdev, ...@@ -380,7 +380,7 @@ static ssize_t read_buffer_kb_store(struct device *csdev,
mutex_lock(&dev->mutex); mutex_lock(&dev->mutex);
s = comedi_read_subdevice(dev, minor); s = comedi_read_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_READ) && s->async) if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
err = resize_async_buffer(dev, s, s->async, size); err = resize_async_buffer(dev, s, size);
else else
err = -EINVAL; err = -EINVAL;
mutex_unlock(&dev->mutex); mutex_unlock(&dev->mutex);
...@@ -493,7 +493,7 @@ static ssize_t write_buffer_kb_store(struct device *csdev, ...@@ -493,7 +493,7 @@ static ssize_t write_buffer_kb_store(struct device *csdev,
mutex_lock(&dev->mutex); mutex_lock(&dev->mutex);
s = comedi_write_subdevice(dev, minor); s = comedi_write_subdevice(dev, minor);
if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async) if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
err = resize_async_buffer(dev, s, s->async, size); err = resize_async_buffer(dev, s, size);
else else
err = -EINVAL; err = -EINVAL;
mutex_unlock(&dev->mutex); mutex_unlock(&dev->mutex);
...@@ -741,7 +741,7 @@ static int do_bufconfig_ioctl(struct comedi_device *dev, ...@@ -741,7 +741,7 @@ static int do_bufconfig_ioctl(struct comedi_device *dev,
} }
if (bc.size) { if (bc.size) {
retval = resize_async_buffer(dev, s, async, bc.size); retval = resize_async_buffer(dev, s, bc.size);
if (retval < 0) if (retval < 0)
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment