linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] staging:iio: Remove declaration for non existing function
@ 2012-02-10 18:24 Lars-Peter Clausen
  2012-02-10 18:24 ` [PATCH 2/2] staging:iio: Remove noop calls to __iio_update_buffer Lars-Peter Clausen
  2012-02-10 21:51 ` [PATCH 1/2] staging:iio: Remove declaration for non existing function Jonathan Cameron
  0 siblings, 2 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2012-02-10 18:24 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen

The declaration for iio_buffer_deinit has been around for quite some time, but
the function itself has never been added. So remove the declaration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/staging/iio/buffer.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/buffer.h b/drivers/staging/iio/buffer.h
index 6fb6e64..df2046d 100644
--- a/drivers/staging/iio/buffer.h
+++ b/drivers/staging/iio/buffer.h
@@ -91,8 +91,6 @@ struct iio_buffer {
  **/
 void iio_buffer_init(struct iio_buffer *buffer);
 
-void iio_buffer_deinit(struct iio_buffer *buffer);
-
 /**
  * __iio_update_buffer() - update common elements of buffers
  * @buffer:		buffer that is the event source
-- 
1.7.9


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] staging:iio: Remove noop calls to __iio_update_buffer
  2012-02-10 18:24 [PATCH 1/2] staging:iio: Remove declaration for non existing function Lars-Peter Clausen
@ 2012-02-10 18:24 ` Lars-Peter Clausen
  2012-02-10 21:55   ` Jonathan Cameron
  2012-02-10 21:51 ` [PATCH 1/2] staging:iio: Remove declaration for non existing function Jonathan Cameron
  1 sibling, 1 reply; 4+ messages in thread
From: Lars-Peter Clausen @ 2012-02-10 18:24 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen

__iio_update_buffer updates the buffer's bytes_per_datum and length attributes.
But in these two cases we indirectly just pass the existing values, so the call
becomes a noop and can be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
We might as well also remove the function itself, since these are the only two
users. What do you think?
---
 drivers/staging/iio/kfifo_buf.c |    1 -
 drivers/staging/iio/ring_sw.c   |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/kfifo_buf.c b/drivers/staging/iio/kfifo_buf.c
index 9f3bd59..468e202 100644
--- a/drivers/staging/iio/kfifo_buf.c
+++ b/drivers/staging/iio/kfifo_buf.c
@@ -22,7 +22,6 @@ static inline int __iio_allocate_kfifo(struct iio_kfifo *buf,
 	if ((length == 0) || (bytes_per_datum == 0))
 		return -EINVAL;
 
-	__iio_update_buffer(&buf->buffer, bytes_per_datum, length);
 	return kfifo_alloc(&buf->kf, bytes_per_datum*length, GFP_KERNEL);
 }
 
diff --git a/drivers/staging/iio/ring_sw.c b/drivers/staging/iio/ring_sw.c
index eeac0da..5664372 100644
--- a/drivers/staging/iio/ring_sw.c
+++ b/drivers/staging/iio/ring_sw.c
@@ -46,7 +46,6 @@ static inline int __iio_allocate_sw_ring_buffer(struct iio_sw_ring_buffer *ring,
 {
 	if ((length == 0) || (bytes_per_datum == 0))
 		return -EINVAL;
-	__iio_update_buffer(&ring->buf, bytes_per_datum, length);
 	ring->data = kmalloc(length*ring->buf.bytes_per_datum, GFP_ATOMIC);
 	ring->read_p = NULL;
 	ring->write_p = NULL;
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] staging:iio: Remove declaration for non existing function
  2012-02-10 18:24 [PATCH 1/2] staging:iio: Remove declaration for non existing function Lars-Peter Clausen
  2012-02-10 18:24 ` [PATCH 2/2] staging:iio: Remove noop calls to __iio_update_buffer Lars-Peter Clausen
@ 2012-02-10 21:51 ` Jonathan Cameron
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2012-02-10 21:51 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: linux-iio

On 02/10/2012 06:24 PM, Lars-Peter Clausen wrote:
> The declaration for iio_buffer_deinit has been around for quite some time, but
> the function itself has never been added. So remove the declaration.
> 
oops
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
>  drivers/staging/iio/buffer.h |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/buffer.h b/drivers/staging/iio/buffer.h
> index 6fb6e64..df2046d 100644
> --- a/drivers/staging/iio/buffer.h
> +++ b/drivers/staging/iio/buffer.h
> @@ -91,8 +91,6 @@ struct iio_buffer {
>   **/
>  void iio_buffer_init(struct iio_buffer *buffer);
>  
> -void iio_buffer_deinit(struct iio_buffer *buffer);
> -
>  /**
>   * __iio_update_buffer() - update common elements of buffers
>   * @buffer:		buffer that is the event source


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] staging:iio: Remove noop calls to __iio_update_buffer
  2012-02-10 18:24 ` [PATCH 2/2] staging:iio: Remove noop calls to __iio_update_buffer Lars-Peter Clausen
@ 2012-02-10 21:55   ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2012-02-10 21:55 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: linux-iio

On 02/10/2012 06:24 PM, Lars-Peter Clausen wrote:
> __iio_update_buffer updates the buffer's bytes_per_datum and length attributes.
> But in these two cases we indirectly just pass the existing values, so the call
> becomes a noop and can be removed.
That is novel.  I hope if I looked back at the history that would make
sense at somepoint and it's just gotten like this via refactoring...
Feel free to drop the function as the __ marks it as very much internal
only and it clearly isn't used internally for anything useful.

Good catch.  Ack is for version with function also removed.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
> We might as well also remove the function itself, since these are the only two
> users. What do you think?
> ---
>  drivers/staging/iio/kfifo_buf.c |    1 -
>  drivers/staging/iio/ring_sw.c   |    1 -
>  2 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/kfifo_buf.c b/drivers/staging/iio/kfifo_buf.c
> index 9f3bd59..468e202 100644
> --- a/drivers/staging/iio/kfifo_buf.c
> +++ b/drivers/staging/iio/kfifo_buf.c
> @@ -22,7 +22,6 @@ static inline int __iio_allocate_kfifo(struct iio_kfifo *buf,
>  	if ((length == 0) || (bytes_per_datum == 0))
>  		return -EINVAL;
>  
> -	__iio_update_buffer(&buf->buffer, bytes_per_datum, length);
>  	return kfifo_alloc(&buf->kf, bytes_per_datum*length, GFP_KERNEL);
>  }
>  
> diff --git a/drivers/staging/iio/ring_sw.c b/drivers/staging/iio/ring_sw.c
> index eeac0da..5664372 100644
> --- a/drivers/staging/iio/ring_sw.c
> +++ b/drivers/staging/iio/ring_sw.c
> @@ -46,7 +46,6 @@ static inline int __iio_allocate_sw_ring_buffer(struct iio_sw_ring_buffer *ring,
>  {
>  	if ((length == 0) || (bytes_per_datum == 0))
>  		return -EINVAL;
> -	__iio_update_buffer(&ring->buf, bytes_per_datum, length);
>  	ring->data = kmalloc(length*ring->buf.bytes_per_datum, GFP_ATOMIC);
>  	ring->read_p = NULL;
>  	ring->write_p = NULL;


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-10 21:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-10 18:24 [PATCH 1/2] staging:iio: Remove declaration for non existing function Lars-Peter Clausen
2012-02-10 18:24 ` [PATCH 2/2] staging:iio: Remove noop calls to __iio_update_buffer Lars-Peter Clausen
2012-02-10 21:55   ` Jonathan Cameron
2012-02-10 21:51 ` [PATCH 1/2] staging:iio: Remove declaration for non existing function Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).