[PATCH] acpi: fan: fix cur_state comparison bugs

Colin King colin.king at canonical.com
Tue May 7 09:14:41 UTC 2013


From: Colin Ian King <colin.king at canonical.com>

Coverity CID #997309: Same on both sides (CONSTANT_EXPRESSION_RESULT)

Fix stupid typos where we are comparing info2->cur_state with itself
rather than info1->cur_state.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/fan/fan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/acpi/fan/fan.c b/src/acpi/fan/fan.c
index 184da1a..3e61259 100644
--- a/src/acpi/fan/fan.c
+++ b/src/acpi/fan/fan.c
@@ -216,13 +216,13 @@ static int fan_test2(fwts_framework *fw)
 							info1->name, info1->cur_state, info2->cur_state);
 							changed = true;
 					}
-					if (info2->cur_state > info2->cur_state) {
+					if (info2->cur_state > info1->cur_state) {
 						fwts_passed(fw, "Fan %s current state increased from %d to %d "
 							"while CPUs were busy.",
 							info1->name, info1->cur_state, info2->cur_state);
 							changed = true;
 					}
-					if (info2->cur_state == info2->cur_state)
+					if (info2->cur_state == info1->cur_state)
 						fwts_log_info(fw, "Fan %s current state did not change from value %d "
 							"while CPUs were busy.",
 							info1->name, info1->cur_state);
-- 
1.8.1.2




More information about the fwts-devel mailing list