From patchwork Sat May 29 01:33:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1485332 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 4FsPGY4hjhz9sW0 for ; Sat, 29 May 2021 11:33:56 +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 1lmnrL-00060q-8W; Sat, 29 May 2021 01:33:51 +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 1lmnrJ-00060k-Lc for fwts-devel@lists.ubuntu.com; Sat, 29 May 2021 01:33:49 +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 1lmnrJ-000892-2c; Sat, 29 May 2021 01:33:49 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: wrap long funtion definitions Date: Fri, 28 May 2021 19:33:47 -0600 Message-Id: <20210529013347.1889808-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.31.1 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" Signed-off-by: Alex Hung Acked-by: Ivan Hu Acked-by: Colin Ian King --- src/acpi/hmat/hmat.c | 15 ++++++++++--- src/acpi/madt/madt.c | 5 ++++- src/acpi/pcct/pcct.c | 50 ++++++++++++++++++++++++++++++++++++-------- src/acpi/phat/phat.c | 16 +++++++++++--- src/acpi/pmtt/pmtt.c | 3 ++- src/acpi/sdev/sdev.c | 10 +++++++-- 6 files changed, 80 insertions(+), 19 deletions(-) diff --git a/src/acpi/hmat/hmat.c b/src/acpi/hmat/hmat.c index ec93ce3b..4c76b0f0 100644 --- a/src/acpi/hmat/hmat.c +++ b/src/acpi/hmat/hmat.c @@ -26,7 +26,10 @@ static fwts_acpi_table_info *table; acpi_table_init(HMAT, &table) -static void hmat_proximity_domain_test(fwts_framework *fw, const fwts_acpi_table_hmat_proximity_domain *entry, bool *passed) +static void hmat_proximity_domain_test( + fwts_framework *fw, + const fwts_acpi_table_hmat_proximity_domain *entry, + bool *passed) { fwts_log_info_verbatim(fw, " Memory Proximity Domain Attributes (Type 0):"); fwts_log_info_simp_int(fw, " Type: ", entry->header.type); @@ -48,7 +51,10 @@ static void hmat_proximity_domain_test(fwts_framework *fw, const fwts_acpi_table fwts_acpi_reserved_zero("HMAT", "Reserved", entry->reserved4, passed); } -static void hmat_locality_test(fwts_framework *fw, const fwts_acpi_table_hmat_locality *entry, bool *passed) +static void hmat_locality_test( + fwts_framework *fw, + const fwts_acpi_table_hmat_locality *entry, + bool *passed) { uint32_t pd_size; uint16_t reserved1 = (entry->reserved1 << 8) + entry->min_transfer_size; @@ -103,7 +109,10 @@ static void hmat_locality_test(fwts_framework *fw, const fwts_acpi_table_hmat_lo } } -static void hmat_cache_test(fwts_framework *fw, const fwts_acpi_table_hmat_cache *entry, bool *passed) +static void hmat_cache_test( + fwts_framework *fw, + const fwts_acpi_table_hmat_cache *entry, + bool *passed) { fwts_log_info_verbatim(fw, " Memory Side Cache Information (Type 2):"); fwts_log_info_simp_int(fw, " Type: ", entry->header.type); diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c index dd835392..7173023a 100644 --- a/src/acpi/madt/madt.c +++ b/src/acpi/madt/madt.c @@ -567,7 +567,10 @@ static const char *madt_sub_names[] = { }; /* check flags points to Table 5-48 Local APIC Flags */ -static void check_madt_apic_flags(fwts_framework *fw, uint8_t type, uint32_t flags) +static void check_madt_apic_flags( + fwts_framework *fw, + const uint8_t type, + const uint32_t flags) { fwts_acpi_table_madt *madt = (fwts_acpi_table_madt *) mtable->data; bool passed = true; diff --git a/src/acpi/pcct/pcct.c b/src/acpi/pcct/pcct.c index cec21f38..31ef30b8 100644 --- a/src/acpi/pcct/pcct.c +++ b/src/acpi/pcct/pcct.c @@ -26,7 +26,11 @@ static fwts_acpi_table_info *table; acpi_table_init(PCCT, &table) -static bool subspace_length_equal(fwts_framework *fw, uint8_t type, uint8_t type_size, uint8_t length) +static bool subspace_length_equal( + fwts_framework *fw, + const uint8_t type, + const uint8_t type_size, + const uint8_t length) { if (type_size != length) { fwts_failed(fw, LOG_LEVEL_HIGH, @@ -39,7 +43,11 @@ static bool subspace_length_equal(fwts_framework *fw, uint8_t type, uint8_t type return true; } -static void gas_messages(fwts_framework *fw, uint8_t type, fwts_acpi_gas *gas, bool *passed) +static void gas_messages( + fwts_framework *fw, + const uint8_t type, + const fwts_acpi_gas *gas, + bool *passed) { char label[20]; @@ -56,7 +64,11 @@ static void gas_messages(fwts_framework *fw, uint8_t type, fwts_acpi_gas *gas, b FWTS_GAS_ADDR_SPACE_ID_FFH); } -static void gas_messages2(fwts_framework *fw, uint8_t type, fwts_acpi_gas *gas, bool *passed) +static void gas_messages2( + fwts_framework *fw, + const uint8_t type, + const fwts_acpi_gas *gas, + bool *passed) { char label[20]; @@ -71,7 +83,12 @@ static void gas_messages2(fwts_framework *fw, uint8_t type, fwts_acpi_gas *gas, FWTS_GAS_ADDR_SPACE_ID_SYSTEM_MEMORY, FWTS_GAS_ADDR_SPACE_ID_SYSTEM_IO); } -static void memory_length(fwts_framework *fw, uint8_t type, uint64_t memory_range, uint64_t min_length, bool *passed) +static void memory_length( + fwts_framework *fw, + const uint8_t type, + const uint64_t memory_range, + const uint64_t min_length, + bool *passed) { switch (type) { case 0 ... 2: @@ -97,7 +114,10 @@ static void memory_length(fwts_framework *fw, uint8_t type, uint64_t memory_rang } } -static void generic_comm_test(fwts_framework *fw, fwts_acpi_table_pcct_subspace_type_0 *entry, bool *passed) +static void generic_comm_test( + fwts_framework *fw, + const fwts_acpi_table_pcct_subspace_type_0 *entry, + bool *passed) { uint64_t reserved; @@ -117,7 +137,10 @@ static void generic_comm_test(fwts_framework *fw, fwts_acpi_table_pcct_subspace_ fwts_log_info_simp_int(fw, " Min Request Turnaround Time: ", entry->min_request_turnaround_time); } -static void hw_reduced_comm_test_type1(fwts_framework *fw, fwts_acpi_table_pcct_subspace_type_1 *entry, bool *passed) +static void hw_reduced_comm_test_type1( + fwts_framework *fw, + const fwts_acpi_table_pcct_subspace_type_1 *entry, + bool *passed) { fwts_log_info_simp_int(fw, " Platform Interrupt: ", entry->platform_interrupt); fwts_log_info_simp_int(fw, " Platform Interrupt Flags: ", entry->platform_interrupt_flags); @@ -135,7 +158,10 @@ static void hw_reduced_comm_test_type1(fwts_framework *fw, fwts_acpi_table_pcct_ fwts_acpi_reserved_bits("PCCT", "Platform Interrupt Flags", entry->platform_interrupt_flags, 2, 7, passed); } -static void hw_reduced_comm_test_type2(fwts_framework *fw, fwts_acpi_table_pcct_subspace_type_2 *entry, bool *passed) +static void hw_reduced_comm_test_type2( + fwts_framework *fw, + const fwts_acpi_table_pcct_subspace_type_2 *entry, + bool *passed) { fwts_log_info_simp_int(fw, " Platform Interrupt: ", entry->platform_interrupt); fwts_log_info_simp_int(fw, " Platform Interrupt Flags: ", entry->platform_interrupt_flags); @@ -157,7 +183,10 @@ static void hw_reduced_comm_test_type2(fwts_framework *fw, fwts_acpi_table_pcct_ fwts_acpi_reserved_bits("PCCT", "Platform Interrupt Flags", entry->platform_interrupt_flags, 2, 7, passed); } -static void extended_pcc_test(fwts_framework *fw, fwts_acpi_table_pcct_subspace_type_3_4 *entry, bool *passed) +static void extended_pcc_test( + fwts_framework *fw, + const fwts_acpi_table_pcct_subspace_type_3_4 *entry, + bool *passed) { fwts_log_info_simp_int(fw, " Platform Interrupt: ", entry->platform_interrupt); fwts_log_info_simp_int(fw, " Platform Interrupt Flags: ", entry->platform_interrupt_flags); @@ -190,7 +219,10 @@ static void extended_pcc_test(fwts_framework *fw, fwts_acpi_table_pcct_subspace_ fwts_acpi_reserved_bits("PCCT", "Platform Interrupt Flags", entry->platform_interrupt_flags, 2, 7, passed); } -static void hw_registers_based_comm_test(fwts_framework *fw, fwts_acpi_table_pcct_subspace_type_5 *entry, bool *passed) +static void hw_registers_based_comm_test( + fwts_framework *fw, + const fwts_acpi_table_pcct_subspace_type_5 *entry, + bool *passed) { fwts_log_info_simp_int(fw, " Version: ", entry->version); fwts_log_info_simp_int(fw, " Base Address: ", entry->base_address); diff --git a/src/acpi/phat/phat.c b/src/acpi/phat/phat.c index 4810b15c..ee1c9750 100644 --- a/src/acpi/phat/phat.c +++ b/src/acpi/phat/phat.c @@ -26,14 +26,20 @@ static fwts_acpi_table_info *table; acpi_table_init(PHAT, &table) -static void print_record_header(fwts_framework *fw, const fwts_acpi_table_phat_header *header) +static void print_record_header( + fwts_framework *fw, + const fwts_acpi_table_phat_header *header) { fwts_log_info_simp_int(fw, " Type: ", header->type); fwts_log_info_simp_int(fw, " Record Length: ", header->length); fwts_log_info_simp_int(fw, " Revision: ", header->revision); } -static void phat_version_test(fwts_framework *fw, fwts_acpi_table_phat_version *entry, uint32_t offset, bool *passed) +static void phat_version_test( + fwts_framework *fw, + fwts_acpi_table_phat_version *entry, + uint32_t offset, + bool *passed) { uint32_t reserved, i; @@ -69,7 +75,11 @@ static void phat_version_test(fwts_framework *fw, fwts_acpi_table_phat_version * fwts_acpi_reserved_zero("PHAT", "Reserved", reserved, passed); } -static void phat_health_test(fwts_framework *fw, fwts_acpi_table_phat_health *entry, uint32_t offset, bool *passed) +static void phat_health_test( + fwts_framework *fw, + fwts_acpi_table_phat_health *entry, + uint32_t offset, + bool *passed) { char *device_path; char guid[37]; diff --git a/src/acpi/pmtt/pmtt.c b/src/acpi/pmtt/pmtt.c index 7515730b..79a4e9e2 100644 --- a/src/acpi/pmtt/pmtt.c +++ b/src/acpi/pmtt/pmtt.c @@ -23,7 +23,8 @@ #include #include -static void pmtt_memory_device(fwts_framework *fw, fwts_acpi_table_pmtt_header *entry, uint32_t offset, bool *passed); +static void pmtt_memory_device(fwts_framework *fw, fwts_acpi_table_pmtt_header *entry, + uint32_t offset, bool *passed); static fwts_acpi_table_info *table; acpi_table_init(PMTT, &table) diff --git a/src/acpi/sdev/sdev.c b/src/acpi/sdev/sdev.c index a115ebc8..2bc74449 100644 --- a/src/acpi/sdev/sdev.c +++ b/src/acpi/sdev/sdev.c @@ -29,7 +29,10 @@ static fwts_acpi_table_info *table; acpi_table_init(SDEV, &table) -static void sdev_acpi_namespace_device_test(fwts_framework *fw, const fwts_acpi_table_sdev_acpi *entry, bool *passed) +static void sdev_acpi_namespace_device_test( + fwts_framework *fw, + const fwts_acpi_table_sdev_acpi *entry, + bool *passed) { fwts_log_info_verbatim(fw, " ACPI Integrated Device (Type 0):"); fwts_log_info_simp_int(fw, " Type: ", entry->header.type); @@ -47,7 +50,10 @@ static void sdev_acpi_namespace_device_test(fwts_framework *fw, const fwts_acpi_ /* TODO - check Secure Access Components - acpica (iasl) supports aren't complete */ } -static void sdev_pcie_endpoint_device_test(fwts_framework *fw, const fwts_acpi_table_sdev_pcie *entry, bool *passed) +static void sdev_pcie_endpoint_device_test( + fwts_framework *fw, + const fwts_acpi_table_sdev_pcie *entry, + bool *passed) { fwts_log_info_verbatim(fw, " PCIe Endpoint Device (Type 1):"); fwts_log_info_simp_int(fw, " Type: ", entry->header.type);