diff options
author | Karol Wrona <k.wrona@samsung.com> | 2014-12-19 12:39:24 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-12-26 06:20:38 -0500 |
commit | 7ab374a053a43050117eb452306b6cd9dcb58cfd (patch) | |
tree | 1605369c59a8e0d07a788f17c93ae02cbcd46e2c | |
parent | 614e8842ddf5502f0e781f91695bfbc1e1e1d9b6 (diff) |
iio: kfifo: Remove unused argument in iio_kfifo_allocate
indio_dev was unused in function body plus some small style fix - add new
lines after "if(sth) return sth" and before the last return statement.
The argument was removed also in its client.
Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 2 | ||||
-rw-r--r-- | drivers/iio/industrialio-triggered-buffer.c | 2 | ||||
-rw-r--r-- | drivers/iio/kfifo_buf.c | 6 | ||||
-rw-r--r-- | drivers/staging/iio/accel/lis3l02dq_ring.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/iio_simple_dummy_buffer.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/impedance-analyzer/ad5933.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7758_ring.c | 2 | ||||
-rw-r--r-- | include/linux/iio/kfifo_buf.h | 2 |
8 files changed, 11 insertions, 9 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index d550ac7d2365..5eea299518a3 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c | |||
@@ -250,7 +250,7 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev, | |||
250 | struct iio_buffer *buffer; | 250 | struct iio_buffer *buffer; |
251 | int ret; | 251 | int ret; |
252 | 252 | ||
253 | buffer = iio_kfifo_allocate(indio_dev); | 253 | buffer = iio_kfifo_allocate(); |
254 | if (!buffer) | 254 | if (!buffer) |
255 | return -ENOMEM; | 255 | return -ENOMEM; |
256 | 256 | ||
diff --git a/drivers/iio/industrialio-triggered-buffer.c b/drivers/iio/industrialio-triggered-buffer.c index 61a5d0404edf..15a5341b5e7b 100644 --- a/drivers/iio/industrialio-triggered-buffer.c +++ b/drivers/iio/industrialio-triggered-buffer.c | |||
@@ -49,7 +49,7 @@ int iio_triggered_buffer_setup(struct iio_dev *indio_dev, | |||
49 | struct iio_buffer *buffer; | 49 | struct iio_buffer *buffer; |
50 | int ret; | 50 | int ret; |
51 | 51 | ||
52 | buffer = iio_kfifo_allocate(indio_dev); | 52 | buffer = iio_kfifo_allocate(); |
53 | if (!buffer) { | 53 | if (!buffer) { |
54 | ret = -ENOMEM; | 54 | ret = -ENOMEM; |
55 | goto error_ret; | 55 | goto error_ret; |
diff --git a/drivers/iio/kfifo_buf.c b/drivers/iio/kfifo_buf.c index b20a9cfbc8ed..7f6fad658e83 100644 --- a/drivers/iio/kfifo_buf.c +++ b/drivers/iio/kfifo_buf.c | |||
@@ -140,18 +140,20 @@ static const struct iio_buffer_access_funcs kfifo_access_funcs = { | |||
140 | .release = &iio_kfifo_buffer_release, | 140 | .release = &iio_kfifo_buffer_release, |
141 | }; | 141 | }; |
142 | 142 | ||
143 | struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev) | 143 | struct iio_buffer *iio_kfifo_allocate(void) |
144 | { | 144 | { |
145 | struct iio_kfifo *kf; | 145 | struct iio_kfifo *kf; |
146 | 146 | ||
147 | kf = kzalloc(sizeof *kf, GFP_KERNEL); | 147 | kf = kzalloc(sizeof(*kf), GFP_KERNEL); |
148 | if (!kf) | 148 | if (!kf) |
149 | return NULL; | 149 | return NULL; |
150 | |||
150 | kf->update_needed = true; | 151 | kf->update_needed = true; |
151 | iio_buffer_init(&kf->buffer); | 152 | iio_buffer_init(&kf->buffer); |
152 | kf->buffer.access = &kfifo_access_funcs; | 153 | kf->buffer.access = &kfifo_access_funcs; |
153 | kf->buffer.length = 2; | 154 | kf->buffer.length = 2; |
154 | mutex_init(&kf->user_lock); | 155 | mutex_init(&kf->user_lock); |
156 | |||
155 | return &kf->buffer; | 157 | return &kf->buffer; |
156 | } | 158 | } |
157 | EXPORT_SYMBOL(iio_kfifo_allocate); | 159 | EXPORT_SYMBOL(iio_kfifo_allocate); |
diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c index 9efc77b0ebdd..1fd90090a633 100644 --- a/drivers/staging/iio/accel/lis3l02dq_ring.c +++ b/drivers/staging/iio/accel/lis3l02dq_ring.c | |||
@@ -393,7 +393,7 @@ int lis3l02dq_configure_buffer(struct iio_dev *indio_dev) | |||
393 | int ret; | 393 | int ret; |
394 | struct iio_buffer *buffer; | 394 | struct iio_buffer *buffer; |
395 | 395 | ||
396 | buffer = iio_kfifo_allocate(indio_dev); | 396 | buffer = iio_kfifo_allocate(); |
397 | if (!buffer) | 397 | if (!buffer) |
398 | return -ENOMEM; | 398 | return -ENOMEM; |
399 | 399 | ||
diff --git a/drivers/staging/iio/iio_simple_dummy_buffer.c b/drivers/staging/iio/iio_simple_dummy_buffer.c index a2d72c102119..360a4c980722 100644 --- a/drivers/staging/iio/iio_simple_dummy_buffer.c +++ b/drivers/staging/iio/iio_simple_dummy_buffer.c | |||
@@ -121,7 +121,7 @@ int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev) | |||
121 | struct iio_buffer *buffer; | 121 | struct iio_buffer *buffer; |
122 | 122 | ||
123 | /* Allocate a buffer to use - here a kfifo */ | 123 | /* Allocate a buffer to use - here a kfifo */ |
124 | buffer = iio_kfifo_allocate(indio_dev); | 124 | buffer = iio_kfifo_allocate(); |
125 | if (buffer == NULL) { | 125 | if (buffer == NULL) { |
126 | ret = -ENOMEM; | 126 | ret = -ENOMEM; |
127 | goto error_ret; | 127 | goto error_ret; |
diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index c50b1380b9aa..39f60aca0838 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c | |||
@@ -626,7 +626,7 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev) | |||
626 | { | 626 | { |
627 | struct iio_buffer *buffer; | 627 | struct iio_buffer *buffer; |
628 | 628 | ||
629 | buffer = iio_kfifo_allocate(indio_dev); | 629 | buffer = iio_kfifo_allocate(); |
630 | if (!buffer) | 630 | if (!buffer) |
631 | return -ENOMEM; | 631 | return -ENOMEM; |
632 | 632 | ||
diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c index 27c3ed6ca468..782fd9a3bc0d 100644 --- a/drivers/staging/iio/meter/ade7758_ring.c +++ b/drivers/staging/iio/meter/ade7758_ring.c | |||
@@ -119,7 +119,7 @@ int ade7758_configure_ring(struct iio_dev *indio_dev) | |||
119 | struct iio_buffer *buffer; | 119 | struct iio_buffer *buffer; |
120 | int ret = 0; | 120 | int ret = 0; |
121 | 121 | ||
122 | buffer = iio_kfifo_allocate(indio_dev); | 122 | buffer = iio_kfifo_allocate(); |
123 | if (!buffer) { | 123 | if (!buffer) { |
124 | ret = -ENOMEM; | 124 | ret = -ENOMEM; |
125 | return ret; | 125 | return ret; |
diff --git a/include/linux/iio/kfifo_buf.h b/include/linux/iio/kfifo_buf.h index 25eeac762e84..1a8d57a41738 100644 --- a/include/linux/iio/kfifo_buf.h +++ b/include/linux/iio/kfifo_buf.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/iio/iio.h> | 5 | #include <linux/iio/iio.h> |
6 | #include <linux/iio/buffer.h> | 6 | #include <linux/iio/buffer.h> |
7 | 7 | ||
8 | struct iio_buffer *iio_kfifo_allocate(struct iio_dev *indio_dev); | 8 | struct iio_buffer *iio_kfifo_allocate(void); |
9 | void iio_kfifo_free(struct iio_buffer *r); | 9 | void iio_kfifo_free(struct iio_buffer *r); |
10 | 10 | ||
11 | #endif | 11 | #endif |