From patchwork Tue May 7 09:14:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 242086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 50F122C0173 for ; Tue, 7 May 2013 19:15:09 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UZdyy-0004CB-86; Tue, 07 May 2013 09:14:48 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UZdys-0004C5-24 for fwts-devel@lists.ubuntu.com; Tue, 07 May 2013 09:14:42 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1UZdyr-0001SD-QM for fwts-devel@lists.ubuntu.com; Tue, 07 May 2013 09:14:41 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: fan: fix cur_state comparison bugs Date: Tue, 7 May 2013 10:14:41 +0100 Message-Id: <1367918081-19096-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.1.2 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King 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 Acked-by: Alex Hung Acked-by: Keng-Yu Lin --- 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);