From patchwork Wed Jan 16 01:01:16 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: 212362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id EEE492C0095 for ; Wed, 16 Jan 2013 12:01:18 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TvHNV-0000FA-QP; Wed, 16 Jan 2013 01:01:17 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TvHNU-0000F5-JL for fwts-devel@lists.ubuntu.com; Wed, 16 Jan 2013 01:01:16 +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 1TvHNU-0008NJ-H9 for fwts-devel@lists.ubuntu.com; Wed, 16 Jan 2013 01:01:16 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] apci: apicinstance: clean up smatch warning Date: Wed, 16 Jan 2013 01:01:16 +0000 Message-Id: <1358298076-7523-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King smatch gets confused by the use of count to check if the madt table has been set and the code is a little bit clearer if we just check to see if the table is not set by checking if it is NULL. Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Alex Hung --- src/acpi/apicinstance/apicinstance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/acpi/apicinstance/apicinstance.c b/src/acpi/apicinstance/apicinstance.c index 245aa48..d2376de 100644 --- a/src/acpi/apicinstance/apicinstance.c +++ b/src/acpi/apicinstance/apicinstance.c @@ -43,7 +43,7 @@ static int apicinstance_test1(fwts_framework *fw) table->name, (unsigned long long)table->addr, (int)table->length); - if (count == 0) + if (first_madt_table == NULL) first_madt_table = table; else { if ((first_madt_table->length == table->length) &&