From: Matt Ranostay <mranostay@gmail.com>
To: jic23@kernel.org
Cc: linux-iio@vger.kernel.org, dcb314@hotmail.com, pmeerw@pmeerw.net,
Matt Ranostay <mranostay@gmail.com>
Subject: [PATCH] iio: light: apds9960: correct FIFO check condition
Date: Thu, 17 Mar 2016 20:48:07 -0700 [thread overview]
Message-ID: <1458272888-26146-1-git-send-email-mranostay@gmail.com> (raw)
Correct issue that the last entry in FIFO was being read twice due
to an incorrect decrement of entry count variable before condition
check.
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
drivers/iio/light/apds9960.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c
index f6a07dc..a6af56a 100644
--- a/drivers/iio/light/apds9960.c
+++ b/drivers/iio/light/apds9960.c
@@ -769,7 +769,7 @@ static void apds9960_read_gesture_fifo(struct apds9960_data *data)
mutex_lock(&data->lock);
data->gesture_mode_running = 1;
- while (cnt-- || (cnt = apds9660_fifo_is_empty(data) > 0)) {
+ while (cnt || (cnt = apds9660_fifo_is_empty(data) > 0)) {
ret = regmap_bulk_read(data->regmap, APDS9960_REG_GFIFO_BASE,
&data->buffer, 4);
@@ -777,6 +777,7 @@ static void apds9960_read_gesture_fifo(struct apds9960_data *data)
goto err_read;
iio_push_to_buffers(data->indio_dev, data->buffer);
+ cnt--;
}
err_read:
--
2.7.0
next reply other threads:[~2016-03-18 3:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 3:48 Matt Ranostay [this message]
2016-03-20 10:34 ` [PATCH] iio: light: apds9960: correct FIFO check condition Jonathan Cameron
[not found] ` <1458272888-26146-2-git-send-email-mranostay@gmail.com>
2016-03-26 3:42 ` [PATCH] iio: health: max30100: " Matt Ranostay
2016-03-28 9:10 ` Jonathan Cameron
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=1458272888-26146-1-git-send-email-mranostay@gmail.com \
--to=mranostay@gmail.com \
--cc=dcb314@hotmail.com \
--cc=jic23@kernel.org \
--cc=linux-iio@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 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).