[PATCH] lib: fwts_acpi_tables: remove redundant initialization of ret
Colin King
colin.king at canonical.com
Mon Jun 10 11:57:12 UTC 2019
From: Colin Ian King <colin.king at canonical.com>
The variable ret is being initialized however that value is never
read because ret is being re-assigned on various code paths that
follow it. Hence the initialization is redundant and can be removed.
Also add a { } braces to clean up code style.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/lib/src/fwts_acpi_tables.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
index 88f484b7..a7144f76 100644
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -1204,7 +1204,7 @@ static int fwts_acpi_load_tables_from_sysfs(fwts_framework *fw)
*/
int fwts_acpi_load_tables(fwts_framework *fw)
{
- int ret = FWTS_ERROR;
+ int ret;
bool require_fixup = false;
if (fw->acpi_table_path != NULL) {
@@ -1221,8 +1221,9 @@ int fwts_acpi_load_tables(fwts_framework *fw)
ret = fwts_acpi_load_tables_from_sysfs(fw);
require_fixup = true;
}
- } else
+ } else {
ret = FWTS_ERROR_NO_PRIV;
+ }
if (ret == FWTS_OK) {
acpi_tables_loaded = ACPI_TABLES_LOADED_OK;
--
2.20.1
More information about the fwts-devel
mailing list