From patchwork Wed Aug 15 13:11:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 957891 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41r8xl5jmDz9sCP; Wed, 15 Aug 2018 23:11:55 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fpvaZ-00040v-6V; Wed, 15 Aug 2018 13:11:51 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fpvaO-0003qR-KF for fwts-devel@lists.ubuntu.com; Wed, 15 Aug 2018 13:11:40 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fpvaN-00087E-2P; Wed, 15 Aug 2018 13:11:39 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 18/27] acpi: nfit: rename table to nfit_table to avoid name shadowing Date: Wed, 15 Aug 2018 14:11:20 +0100 Message-Id: <20180815131129.24146-19-colin.king@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180815131129.24146-1-colin.king@canonical.com> References: <20180815131129.24146-1-colin.king@canonical.com> MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" From: Colin Ian King Function scan_nfit_smbios uses the argument table which shadows another table in the scope of the source. Rename table to nfit_table to avoid any shadowing and scoping confusion. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/acpi/nfit/nfit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/acpi/nfit/nfit.c b/src/acpi/nfit/nfit.c index 53c86c24..d5f23df2 100644 --- a/src/acpi/nfit/nfit.c +++ b/src/acpi/nfit/nfit.c @@ -38,7 +38,7 @@ static const uint8_t guid_virtual_device[4][16] = { { 0x88, 0x81, 0x01, 0x08, 0xcd, 0x42, 0x48, 0xbb, 0x10, 0x0f, 0x53, 0x87, 0xd5, 0x3d, 0xed, 0x3d }, }; -static fwts_acpi_table_info *table; +static fwts_acpi_table_info *nfit_table; static bool check_length(fwts_framework *fw, int actual, int min, const char *name) { if (actual < min) { @@ -96,11 +96,11 @@ static bool scan_nfit_smbios(fwts_framework *fw, int len, uint8_t *table) { static int nfit_init(fwts_framework *fw) { - if (fwts_acpi_find_table(fw, "NFIT", 0, &table) != FWTS_OK) { + if (fwts_acpi_find_table(fw, "NFIT", 0, &nfit_table) != FWTS_OK) { fwts_log_error(fw, "Cannot read ACPI tables."); return FWTS_ERROR; } - if (table == NULL || (table && table->length == 0)) { + if (nfit_table == NULL || (nfit_table && nfit_table->length == 0)) { fwts_log_error(fw, "ACPI NFIT table does not exist, skipping test"); return FWTS_SKIP; } @@ -112,7 +112,7 @@ static int nfit_init(fwts_framework *fw) */ static int nfit_test1(fwts_framework *fw) { - fwts_acpi_table_nfit *nfit = (fwts_acpi_table_nfit*) table->data; + fwts_acpi_table_nfit *nfit = (fwts_acpi_table_nfit*)nfit_table->data; fwts_acpi_table_nfit_struct_header *entry; uint32_t offset; bool passed = true; @@ -124,9 +124,9 @@ static int nfit_test1(fwts_framework *fw) fwts_acpi_reserved_zero_check(fw, "NFIT", "Reserved", nfit->reserved, sizeof(nfit->reserved), &passed); offset = sizeof(fwts_acpi_table_nfit); - entry = (fwts_acpi_table_nfit_struct_header *) (table->data + offset); + entry = (fwts_acpi_table_nfit_struct_header *)(nfit_table->data + offset); - while (offset < table->length) { + while (offset < nfit_table->length) { uint64_t reserved_passed = 0; fwts_log_info_verbatim(fw, " NFIT Subtable:"); @@ -506,7 +506,7 @@ static int nfit_test1(fwts_framework *fw) fwts_acpi_reserved_zero_check(fw, "NFIT", "Reserved", reserved_passed, sizeof(reserved_passed), &passed); fwts_log_nl(fw); offset += entry->length; - entry = (fwts_acpi_table_nfit_struct_header *) (table->data + offset); + entry = (fwts_acpi_table_nfit_struct_header *)(nfit_table->data + offset); }