All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Hartmut Knaack <knaack.h@gmx.de>, linux-iio@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Tiberiu Breana <tiberiu.a.breana@intel.com>
Subject: Re: [PATCH v2 7/7] iio:accel:stk8312: drop local buffer
Date: Sat, 8 Aug 2015 12:25:08 +0100	[thread overview]
Message-ID: <55C5E714.2050009@kernel.org> (raw)
In-Reply-To: <f3fe313ea881ad695de6b088b60cd7efbe0cc38d.1438204273.git.knaack.h@gmx.de>

On 29/07/15 22:39, Hartmut Knaack wrote:
> Drop the local buffer in stk8312_trigger_handler() and use data->buffer
> instead for bulk reads.
> 
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com>
Applied.

Thanks,

Jonathan
> ---
>  drivers/iio/accel/stk8312.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c
> index 39eb9f4ea5c0..c88baabe08e7 100644
> --- a/drivers/iio/accel/stk8312.c
> +++ b/drivers/iio/accel/stk8312.c
> @@ -435,7 +435,6 @@ static irqreturn_t stk8312_trigger_handler(int irq, void *p)
>  	struct iio_dev *indio_dev = pf->indio_dev;
>  	struct stk8312_data *data = iio_priv(indio_dev);
>  	int bit, ret, i = 0;
> -	u8 buffer[STK8312_ALL_CHANNEL_SIZE];
>  
>  	mutex_lock(&data->lock);
>  	/*
> @@ -446,15 +445,12 @@ static irqreturn_t stk8312_trigger_handler(int irq, void *p)
>  		ret = i2c_smbus_read_i2c_block_data(data->client,
>  						    STK8312_REG_XOUT,
>  						    STK8312_ALL_CHANNEL_SIZE,
> -						    buffer);
> +						    data->buffer);
>  		if (ret < STK8312_ALL_CHANNEL_SIZE) {
>  			dev_err(&data->client->dev, "register read failed\n");
>  			mutex_unlock(&data->lock);
>  			goto err;
>  		}
> -		data->buffer[0] = buffer[0];
> -		data->buffer[1] = buffer[1];
> -		data->buffer[2] = buffer[2];
>  	} else {
>  		for_each_set_bit(bit, indio_dev->active_scan_mask,
>  				 indio_dev->masklength) {
> 


      reply	other threads:[~2015-08-08 11:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 21:39 [PATCH v2 0/7] stk8312 fixes and cleanup Hartmut Knaack
2015-07-29 21:39 ` [PATCH v2 1/7] iio:accel:stk8312: add triggered buffer dependency Hartmut Knaack
2015-07-29 21:39 ` [PATCH v2 2/7] iio:accel:stk8312: check for invalid value Hartmut Knaack
2015-07-30  7:09   ` Crt Mori
2015-07-31 22:54     ` Hartmut Knaack
2015-08-01  7:35       ` Crt Mori
2015-08-06 22:23         ` Hartmut Knaack
2015-08-08 11:18           ` Jonathan Cameron
2015-08-10  9:24             ` Breana, Tiberiu A
2015-08-11 18:32               ` Hartmut Knaack
2015-07-29 21:39 ` [PATCH v2 3/7] iio:accel:stk8312: improve error handling Hartmut Knaack
2015-07-30  7:04   ` Crt Mori
2015-07-30  9:07     ` Breana, Tiberiu A
2015-07-30  9:39       ` Crt Mori
2015-07-31 23:45       ` Hartmut Knaack
2015-08-01  7:40         ` Crt Mori
2015-08-03  8:05           ` Breana, Tiberiu A
2015-08-08 11:21             ` Jonathan Cameron
2015-07-29 21:39 ` [PATCH v2 4/7] iio:accel:stk8312: rework macro definitions Hartmut Knaack
2015-08-08 11:22   ` Jonathan Cameron
2015-07-29 21:39 ` [PATCH v2 5/7] iio:accel:stk8312: use appropriate variable types Hartmut Knaack
2015-08-08 11:23   ` Jonathan Cameron
2015-07-29 21:39 ` [PATCH v2 6/7] iio:accel:stk8312: code style cleanup Hartmut Knaack
2015-08-08 11:24   ` Jonathan Cameron
2015-07-29 21:39 ` [PATCH v2 7/7] iio:accel:stk8312: drop local buffer Hartmut Knaack
2015-08-08 11:25   ` 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=55C5E714.2050009@kernel.org \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=tiberiu.a.breana@intel.com \
    /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.