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

* Re: [PATCH] iio: st_sensors: Fix buffer copy
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Denis CIOCCA @ 2014-10-03 13:50 UTC (permalink / raw)
  To: Robin van der Gracht, jic23@kernel.org; +Cc: linux-iio@vger.kernel.org

Acked-by: Denis Ciocca <denis.ciocca@st.com>

Thanks!

Denis

On 09/29/14 15:00, Robin van der Gracht wrote:
> 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

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

* Re: [PATCH] iio: st_sensors: Fix buffer copy
  2014-10-03 13:50 ` Denis CIOCCA
@ 2014-10-04 11:12   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2014-10-04 11:12 UTC (permalink / raw)
  To: Denis CIOCCA, Robin van der Gracht; +Cc: linux-iio@vger.kernel.org

On 03/10/14 14:50, Denis CIOCCA wrote:
> Acked-by: Denis Ciocca <denis.ciocca@st.com>
Applied to fixes-togreg branch of iio.git and marked for stable.

Note that given the timing this will probably not hit
mainline until after the coming merge window. Only
after that will it get picked up for stable.

Jonathan
> 
> Thanks!
> 
> Denis
> 
> On 09/29/14 15:00, Robin van der Gracht wrote:
>> 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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[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