From patchwork Tue Feb 28 19:02:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 733768 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3vXnyj0Slxz9s83; Wed, 1 Mar 2017 06:02:53 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1cin2x-0008H5-SQ; Tue, 28 Feb 2017 19:02:51 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1cin2q-0008FM-HP for fwts-devel@lists.ubuntu.com; Tue, 28 Feb 2017 19:02:44 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1cin2q-0000qs-6O; Tue, 28 Feb 2017 19:02:44 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/3] acpi: mpst: remove redundant assigments to passed on errors Date: Tue, 28 Feb 2017 19:02:41 +0000 Message-Id: <20170228190243.32225-2-colin.king@canonical.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170228190243.32225-1-colin.king@canonical.com> References: <20170228190243.32225-1-colin.king@canonical.com> MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King 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 Acked-by: Alex Hung Acked-by: Ivan Hu --- 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");