Skip to contentSkip to conversation

thinkpad-acpi: Fix wrong assignment

PATCH NAK Felipe Pena 2 participants 2 messages Oct 18, 2013 – Oct 24, 2013 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thinkpad-acpi: Fix wrong assignment

In the thermal_init function when checking for thinkpad_id.ec_model, the 'ta2' variable is being OR'd when acpi_ec_read call succeeds, on fail it is setting 0 to 'ta1' variable instead.

---
 drivers/platform/x86/thinkpad_acpi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/thinkpad_acpi.c +1 -1
index 03ca6c1..ac6f938 100644
@@ -5730,7 +5730,7 @@ static int __init thermal_init(struct ibm_init_struct *iibm)
 			if (acpi_ec_read(TP_EC_THERMAL_TMP8 + i, &t)) {
 				ta2 |= t;
 			} else {
-				ta1 = 0;
+				ta2 = 0;
 				break;
 			}
 		}

--
1.7.10.4

#1 lore raw
Quoted 5 lines · Felipe Pena

In the thermal_init function when checking for thinkpad_id.ec_model, the 'ta2' variable is being OR'd when acpi_ec_read call succeeds, on fail it is setting 0 to 'ta1' variable instead.

NAK.

ta1 == 0 implies malfunction on the direct-from-EC temperature reading, which is what the code wants to signal. The code is correct as is.

Do not merge this patch.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh