[prev in list] [next in list] [prev in thread] [next in thread]
List: fwts-devel
Subject: [PATCH] acpi: wrap long funtion definitions
From: Alex Hung <alex.hung () canonical ! com>
Date: 2021-05-29 1:33:47
Message-ID: 20210529013347.1889808-1-alex.hung () canonical ! com
[Download RAW message or body]
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
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 <inttypes.h>
#include <stdbool.h>
-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);
--
2.31.1
--
fwts-devel mailing list
fwts-devel@lists.ubuntu.com
Modify settings or unsubscribe at: \
https://lists.ubuntu.com/mailman/listinfo/fwts-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic