From patchwork Fri May 14 19:21:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1478651 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FhdhD4JzSz9sWY for ; Sat, 15 May 2021 05:22:20 +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 1lhdO6-00034v-1a; Fri, 14 May 2021 19:22:18 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lhdNx-00033V-Fa for fwts-devel@lists.ubuntu.com; Fri, 14 May 2021 19:22:09 +0000 Received: from d75-158-101-9.abhsia.telus.net ([75.158.101.9] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lhdNx-0007En-0T; Fri, 14 May 2021 19:22:09 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH 6/6] lib: acpi: fix incorrect actual vs. struct length outputs Date: Fri, 14 May 2021 13:21:55 -0600 Message-Id: <20210514192155.593354-6-alex.hung@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514192155.593354-1-alex.hung@canonical.com> References: <20210514192155.593354-1-alex.hung@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" Also changes the arg names for better readability. Signed-off-by: Alex Hung Acked-by: Ivan Hu Acked-by: Colin Ian King --- src/lib/include/fwts_acpi_tables.h | 2 +- src/lib/src/fwts_acpi_tables.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/include/fwts_acpi_tables.h b/src/lib/include/fwts_acpi_tables.h index fa641f04..8ed65841 100644 --- a/src/lib/include/fwts_acpi_tables.h +++ b/src/lib/include/fwts_acpi_tables.h @@ -75,7 +75,7 @@ void fwts_acpi_reserved_zero_array(fwts_framework *fw, const char *table, const void fwts_acpi_reserved_bits_(fwts_framework *fw, const char *table, const char *field, uint64_t value, uint8_t size, uint8_t min, uint8_t max, bool *passed); void fwts_acpi_reserved_type(fwts_framework *fw, const char *table, uint8_t value, uint8_t min, uint8_t reserved, bool *passed); bool fwts_acpi_table_length(fwts_framework *fw, const char *table, uint32_t length, uint32_t size); -bool fwts_acpi_structure_length(fwts_framework *fw, const char *table, uint8_t subtable_type, uint32_t subtable_length, uint32_t size); +bool fwts_acpi_structure_length(fwts_framework *fw, const char *table, uint8_t type, uint32_t actual_length, uint32_t struct_length); bool fwts_acpi_structure_length_zero(fwts_framework *fw, const char *table, uint16_t length, uint32_t offset); bool fwts_acpi_structure_range(fwts_framework *fw, const char *table, uint32_t table_length, uint32_t offset); void fwts_acpi_fixed_value(fwts_framework *fw, fwts_log_level level, const char *table, const char *field, uint8_t actual, uint8_t must_be, bool *passed); diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index 18c1e123..e69dc04e 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -1730,10 +1730,10 @@ bool fwts_acpi_structure_length( fwts_framework *fw, const char *table, uint8_t type, - uint32_t length, - uint32_t size) + uint32_t actual_length, + uint32_t struct_length) { - if (length != size) { + if (actual_length != struct_length) { char label[30]; strncpy(label, table, 4); /* ACPI name is 4 char long */ @@ -1741,7 +1741,7 @@ bool fwts_acpi_structure_length( fwts_failed(fw, LOG_LEVEL_CRITICAL, label, "%4.4s structure Type 0x%2.2" PRIx8 " should have " "length 0x%2.2" PRIx8 ", got 0x%2.2" PRIx8, - table, type, length, size); + table, type, struct_length, actual_length); return false; } return true;