diff mbox series

acpi: mpam: fix build fail on bionic

Message ID 20230630052647.414707-1-ivan.hu@canonical.com
State Accepted
Headers show
Series acpi: mpam: fix build fail on bionic | expand

Commit Message

ivanhu June 30, 2023, 5:26 a.m. UTC
BugLink: https://bugs.launchpad.net/fwts/+bug/2025419

acpi/mpam/mpam.c:118:6: error: a label can only be part of a statement and a declaration is not a statement
      fwts_interconnect_locator_descriptor *intc_loc_des =
      ^
acpi/mpam/mpam.c:120:6: error: expected expression before ‘fwts_interconnect_descriptor_table’
      fwts_interconnect_descriptor_table *intc_des_table = (table->data + intc_loc_des->intc_des_tbl_offset);
      ^
acpi/mpam/mpam.c:126:39: error: ‘intc_des_table’ undeclared (first use in this function)
      fwts_hexdump_data_prefix_all(fw, intc_des_table->signature, "          ", sizeof(intc_des_table->signature));
                                       ^
acpi/mpam/mpam.c:126:39: note: each undeclared identifier is reported only once for each function it appears in
acpi/mpam/mpam.c:118:44: error: unused variable ‘intc_loc_des’ [-Werror=unused-variable]
      fwts_interconnect_locator_descriptor *intc_loc_des =
                                            ^
acpi/mpam/mpam.c: At top level:

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/acpi/mpam/mpam.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/src/acpi/mpam/mpam.c b/src/acpi/mpam/mpam.c
index caade74e..7d530889 100644
--- a/src/acpi/mpam/mpam.c
+++ b/src/acpi/mpam/mpam.c
@@ -89,6 +89,9 @@  static int mpam_test1(fwts_framework *fw)
 			fwts_log_info_simp_int(fw, "    Locator type:                      ", res_node->locator_type);
 			fwts_log_info_verbatim(fw, "    Locator:");
 
+			fwts_interconnect_locator_descriptor *intc_loc_des = NULL;
+			fwts_interconnect_descriptor_table *intc_des_table = NULL;
+
 			switch(res_node->locator_type) {
 				case FWTS_MPAM_PROCESSOR_CACHE:
 					fwts_log_info_verbatim(fw, "      Processor cache locator:");
@@ -115,9 +118,8 @@  static int mpam_test1(fwts_framework *fw)
 					fwts_hexdump_data_prefix_all(fw, res_node->locator, "        ", sizeof(res_node->locator));
 					break;
 				case FWTS_MPAM_INTERCONNECT:
-					fwts_interconnect_locator_descriptor *intc_loc_des =
-							(fwts_interconnect_locator_descriptor *)res_node->locator;
-					fwts_interconnect_descriptor_table *intc_des_table = (table->data + intc_loc_des->intc_des_tbl_offset);
+					intc_loc_des = (fwts_interconnect_locator_descriptor *)res_node->locator;
+					intc_des_table = (table->data + intc_loc_des->intc_des_tbl_offset);
 					fwts_log_info_verbatim(fw, "      Interconnect locator:");
 					fwts_hexdump_data_prefix_all(fw, res_node->locator, "        ", sizeof(res_node->locator));
 					fwts_acpi_reserved_zero_array(fw, "MPAM", "Locator", res_node->locator + 8, 4, &passed);