[PATCH 1/3] acpi: mpst: remove redundant assigments to passed on errors
Colin King
colin.king at canonical.com
Tue Feb 28 19:02:41 UTC 2017
From: Colin Ian King <colin.king at canonical.com>
There are several occurrances where passed is set to false and
the error exit path via the error label is a direct return hence
the setting of passed is redundant and can be removed.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/acpi/mpst/mpst.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/acpi/mpst/mpst.c b/src/acpi/mpst/mpst.c
index b817687..db20df7 100644
--- a/src/acpi/mpst/mpst.c
+++ b/src/acpi/mpst/mpst.c
@@ -79,7 +79,6 @@ static int mpst_test1(fwts_framework *fw)
node_offset = sizeof(fwts_acpi_table_mpst) + (sizeof(fwts_acpi_table_mpst_power_node_list));
if (mpst->header.length < node_offset + sizeof(fwts_acpi_table_mpst_power_node) * node_list->count) {
- passed = false;
fwts_failed(fw, LOG_LEVEL_HIGH,
"MPSTOutOfBound",
"MPST's table length is too small to contain all sub-tables");
@@ -130,7 +129,6 @@ static int mpst_test1(fwts_framework *fw)
node_offset += sizeof(fwts_acpi_table_mpst_power_node);
if (mpst->header.length < node_offset + sizeof(fwts_acpi_table_mpst_power_state) * power_node->num_states) {
- passed = false;
fwts_failed(fw, LOG_LEVEL_HIGH,
"MPSTOutOfBound",
"MPST's table length is too small to contain all sub-tables");
@@ -145,7 +143,6 @@ static int mpst_test1(fwts_framework *fw)
}
if (mpst->header.length < node_offset + sizeof(fwts_acpi_table_mpst_component) * power_node->num_components) {
- passed = false;
fwts_failed(fw, LOG_LEVEL_HIGH,
"MPSTOutOfBound",
"MPST's table length is too small to contain all sub-tables");
@@ -173,7 +170,6 @@ static int mpst_test1(fwts_framework *fw)
node_offset += sizeof(fwts_acpi_table_mpst_power_char_list);
if (mpst->header.length < node_offset + sizeof(fwts_acpi_table_mpst_power_char) * char_list->count) {
- passed = false;
fwts_failed(fw, LOG_LEVEL_HIGH,
"MPSTOutOfBound",
"MPST's table length is too small to contain all sub-tables");
--
2.10.2
More information about the fwts-devel
mailing list