[PATCH] lib: fwts_acpi_tables: remove dead assignment of facs

Colin King colin.king at canonical.com
Tue May 23 09:47:57 UTC 2017


From: Colin Ian King <colin.king at canonical.com>

facs is only required if the table does not exist and one
needs to be faked.  Remove the redundant dead assignment. Detected
by scan-build.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/lib/src/fwts_acpi_tables.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
index 1d4fc705..f7547c43 100644
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -970,7 +970,6 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
 	fwts_acpi_table_info *table;
 	fwts_acpi_table_rsdp *rsdp = NULL;
 	fwts_acpi_table_fadt *fadt = NULL;
-	fwts_acpi_table_facs *facs = NULL;
 	uint64_t rsdt_fake_addr = 0, xsdt_fake_addr = 0;
 	bool redo_rsdp_checksum = false;
 
@@ -992,11 +991,10 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
 		fwts_log_error(fw, "ACPI table find failure.");
 		return FWTS_ERROR;
 	}
-	if (table) {
-		facs = (fwts_acpi_table_facs *)table->data;
-	} else {
+	if (!table) {
 		size_t size = 64;
 		uint64_t facs_addr;
+		fwts_acpi_table_facs *facs = NULL;
 
 		/* This is most unexpected, so warn about it */
 		fwts_log_warning(fw, "No FACS found, fwts has faked one instead.");
-- 
2.11.0




More information about the fwts-devel mailing list