Skip to contentSkip to conversation

iio: hid-sensors: typo leads to potential forever loop

PATCH Applied Dan Carpenter 3 participants 3 messages May 9, 2014 – May 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: hid-sensors: typo leads to potential forever loop

The "i < " was missing in this condition.

Fixes 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent')
drivers/iio/common/hid-sensors/hid-sensor-attributes.c +1 -1
index 3729646..3052eb1 100644
@@ -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(
#1 lore raw

OOPs. Good catch.

Thanks,
Srinivas

Quoted 23 lines · Dan Carpenter

The "i < " was missing in this condition.

Fixes 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent')
drivers/iio/common/hid-sensors/hid-sensor-attributes.c +1 -2
index 3729646..3052eb1 100644
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Applied
#2 lore raw
Quoted 10 lines · Srinivas Pandruvada

OOPs. Good catch.

Thanks,
Srinivas

Quoted 4 lines · Dan Carpenter

The "i < " was missing in this condition.

Fixes 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent')

Applied to the togreg branch of iio.igt

Thanks,

Quoted 23 lines
Quoted 14 lines
drivers/iio/common/hid-sensors/hid-sensor-attributes.c +1 -2
index 3729646..3052eb1 100644
@@ -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(
--
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html