All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: kfifo: Set update_needed to false only if a buffer was allocated
Date: Thu, 07 May 2015 23:38:12 +0100	[thread overview]
Message-ID: <554BE954.6030001@kernel.org> (raw)
In-Reply-To: <1430569876-31428-1-git-send-email-gabriele.mzt@gmail.com>

On 02/05/15 13:31, Gabriele Mazzotta wrote:
> Check whether the allocation of a new kfifo buffer failed or not before
> setting the update_needed flag to false. This will make
> iio_request_update_kfifo() try to allocate a new buffer the next time a
> buffer update is requested.
> 
> Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Applied to the fixes to greg branch of iio.git

The way things are going right now, I might actually get time to
push this out on Saturday.... Which is more than I expected this
morning.

J
> ---
>  drivers/iio/kfifo_buf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/kfifo_buf.c b/drivers/iio/kfifo_buf.c
> index 847ca56..55c267b 100644
> --- a/drivers/iio/kfifo_buf.c
> +++ b/drivers/iio/kfifo_buf.c
> @@ -38,7 +38,8 @@ static int iio_request_update_kfifo(struct iio_buffer *r)
>  		kfifo_free(&buf->kf);
>  		ret = __iio_allocate_kfifo(buf, buf->buffer.bytes_per_datum,
>  				   buf->buffer.length);
> -		buf->update_needed = false;
> +		if (ret >= 0)
> +			buf->update_needed = false;
>  	} else {
>  		kfifo_reset_out(&buf->kf);
>  	}
> 


      reply	other threads:[~2015-05-07 23:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-02 12:31 [PATCH] iio: kfifo: Set update_needed to false only if a buffer was allocated Gabriele Mazzotta
2015-05-07 22:38 ` 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=554BE954.6030001@kernel.org \
    --to=jic23@kernel.org \
    --cc=gabriele.mzt@gmail.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.