public inbox for linux-iio@vger.kernel.org
help / color / mirror / Atom feed
* [PATCH] iio: st_sensors: Fix buffer copy
@ 2014-09-29 13:00 Robin van der Gracht
  2014-10-03 13:50 ` Denis CIOCCA
  0 siblings, 1 reply; 3+ messages in thread
From: Robin van der Gracht @ 2014-09-29 13:00 UTC (permalink / raw)
  To: jic23; +Cc: denis.ciocca, linux-iio, Robin van der Gracht

Use byte_for_channel as iterator to properly initialize the buffer.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
---
 drivers/iio/common/st_sensors/st_sensors_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/common/st_sensors/st_sensors_buffer.c b/drivers/iio/common/st_sensors/st_sensors_buffer.c
index 1665c8e..e18bc67 100644
--- a/drivers/iio/common/st_sensors/st_sensors_buffer.c
+++ b/drivers/iio/common/st_sensors/st_sensors_buffer.c
@@ -71,7 +71,7 @@ int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf)
 				goto st_sensors_free_memory;
 			}
 
-			for (i = 0; i < n * num_data_channels; i++) {
+			for (i = 0; i < n * byte_for_channel; i++) {
 				if (i < n)
 					buf[i] = rx_array[i];
 				else
-- 
1.9.1

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

end of thread, other threads:[~2014-10-04 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-29 13:00 [PATCH] iio: st_sensors: Fix buffer copy Robin van der Gracht
2014-10-03 13:50 ` Denis CIOCCA
2014-10-04 11:12   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox