linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] iio: hid-sensors: typo leads to potential forever loop
@ 2014-05-09 11:56 Dan Carpenter
  2014-05-09 16:55 ` Srinivas Pandruvada
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2014-05-09 11:56 UTC (permalink / raw)
  To: Jonathan Cameron, Srinivas Pandruvada; +Cc: linux-iio, kernel-janitors

The "i < " was missing in this condition.

Fixes: 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index 3729646..3052eb1 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -327,7 +327,7 @@ int hid_sensor_format_scale(u32 usage_id,
 	*val0 = 1;
 	*val1 = 0;
 
-	for (i = 0; ARRAY_SIZE(unit_conversion); ++i) {
+	for (i = 0; i < ARRAY_SIZE(unit_conversion); ++i) {
 		if (unit_conversion[i].usage_id == usage_id &&
 			unit_conversion[i].unit == attr_info->units) {
 			exp  = hid_sensor_convert_exponent(

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

* Re: [patch] iio: hid-sensors: typo leads to potential forever loop
  2014-05-09 11:56 [patch] iio: hid-sensors: typo leads to potential forever loop Dan Carpenter
@ 2014-05-09 16:55 ` Srinivas Pandruvada
  2014-05-10 10:38   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Srinivas Pandruvada @ 2014-05-09 16:55 UTC (permalink / raw)
  To: Dan Carpenter, Jonathan Cameron; +Cc: linux-iio, kernel-janitors

OOPs. Good catch.

Thanks,
Srinivas

On 05/09/2014 04:56 AM, Dan Carpenter wrote:
> The "i < " was missing in this condition.
>
> Fixes: 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> index 3729646..3052eb1 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> @@ -327,7 +327,7 @@ int hid_sensor_format_scale(u32 usage_id,
>   	*val0 = 1;
>   	*val1 = 0;
>   
> -	for (i = 0; ARRAY_SIZE(unit_conversion); ++i) {
> +	for (i = 0; i < ARRAY_SIZE(unit_conversion); ++i) {
>   		if (unit_conversion[i].usage_id == usage_id &&
>   			unit_conversion[i].unit == attr_info->units) {
>   			exp  = hid_sensor_convert_exponent(
> --
> 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

* Re: [patch] iio: hid-sensors: typo leads to potential forever loop
  2014-05-09 16:55 ` Srinivas Pandruvada
@ 2014-05-10 10:38   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2014-05-10 10:38 UTC (permalink / raw)
  To: Srinivas Pandruvada, Dan Carpenter; +Cc: linux-iio, kernel-janitors

On 09/05/14 17:55, Srinivas Pandruvada wrote:
> OOPs. Good catch.
>
> Thanks,
> Srinivas
>
> On 05/09/2014 04:56 AM, Dan Carpenter wrote:
>> The "i < " was missing in this condition.
>>
>> Fixes: 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent')
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to the togreg branch of iio.igt

Thanks,

>>
>> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
>> index 3729646..3052eb1 100644
>> --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
>> +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
>> @@ -327,7 +327,7 @@ int hid_sensor_format_scale(u32 usage_id,
>>       *val0 = 1;
>>       *val1 = 0;
>> -    for (i = 0; ARRAY_SIZE(unit_conversion); ++i) {
>> +    for (i = 0; i < ARRAY_SIZE(unit_conversion); ++i) {
>>           if (unit_conversion[i].usage_id == usage_id &&
>>               unit_conversion[i].unit == attr_info->units) {
>>               exp  = hid_sensor_convert_exponent(
>> --
>> 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
>>
>
> --
> 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-05-10 10:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-09 11:56 [patch] iio: hid-sensors: typo leads to potential forever loop Dan Carpenter
2014-05-09 16:55 ` Srinivas Pandruvada
2014-05-10 10:38   ` Jonathan Cameron

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).