linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@cam.ac.uk>, linux-iio@vger.kernel.org
Subject: Re: [PATCH] staging:iio: Remove noop call to __iio_update_buffer
Date: Wed, 30 Jan 2013 21:17:16 +0000	[thread overview]
Message-ID: <51098DDC.70102@kernel.org> (raw)
In-Reply-To: <1359367938-26398-1-git-send-email-lars@metafoo.de>

On 01/28/2013 10:12 AM, Lars-Peter Clausen wrote:
> __iio_update_buffer updates the buffer's bytes_per_datum and length fields.
> But the only user of this function just passes in these exact fields, so the
> call basically looks like this:
> 
> 	buffer->bytes_per_datum = buffer->bytes_per_datum;
> 	buffer->length = buffer->length;
> 
> Which means it is a noop and can be removed. Also remove the function itself,
> since it is now unused.
Good spot.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
added to togreg branch of iio.git
> ---
>  drivers/iio/kfifo_buf.c    |  1 -
>  include/linux/iio/buffer.h | 13 -------------
>  2 files changed, 14 deletions(-)
> 
> diff --git a/drivers/iio/kfifo_buf.c b/drivers/iio/kfifo_buf.c
> index 5bc5c86..a923c78 100644
> --- a/drivers/iio/kfifo_buf.c
> +++ b/drivers/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((struct __kfifo *)&buf->kf, length,
>  			     bytes_per_datum, GFP_KERNEL);
>  }
> diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
> index f3eea18..2bac0eb 100644
> --- a/include/linux/iio/buffer.h
> +++ b/include/linux/iio/buffer.h
> @@ -103,19 +103,6 @@ int iio_update_buffers(struct iio_dev *indio_dev,
>   **/
>  void iio_buffer_init(struct iio_buffer *buffer);
>  
> -/**
> - * __iio_update_buffer() - update common elements of buffers
> - * @buffer:		buffer that is the event source
> - * @bytes_per_datum:	size of individual datum including timestamp
> - * @length:		number of datums in buffer
> - **/
> -static inline void __iio_update_buffer(struct iio_buffer *buffer,
> -				       int bytes_per_datum, int length)
> -{
> -	buffer->bytes_per_datum = bytes_per_datum;
> -	buffer->length = length;
> -}
> -
>  int iio_scan_mask_query(struct iio_dev *indio_dev,
>  			struct iio_buffer *buffer, int bit);
>  
> 

      reply	other threads:[~2013-01-30 21:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28 10:12 [PATCH] staging:iio: Remove noop call to __iio_update_buffer Lars-Peter Clausen
2013-01-30 21:17 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51098DDC.70102@kernel.org \
    --to=jic23@kernel.org \
    --cc=jic23@cam.ac.uk \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).