From patchwork Mon Jun 10 11:57:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1113062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Ms7d59mjz9s00; Mon, 10 Jun 2019 21:57:17 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1haIvK-0007Pg-83; Mon, 10 Jun 2019 11:57:14 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1haIvJ-0007PF-32 for fwts-devel@lists.ubuntu.com; Mon, 10 Jun 2019 11:57:13 +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 1haIvI-00069d-N5; Mon, 10 Jun 2019 11:57:12 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] lib: fwts_acpi_tables: remove redundant initialization of ret Date: Mon, 10 Jun 2019 12:57:12 +0100 Message-Id: <20190610115712.29702-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 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" From: Colin Ian King 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 Acked-by: Alex Hung Acked-by: Ivan Hu --- 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;