From patchwork Tue Jan 23 12:16:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 864748 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=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3zQnNG3pZbz9t3n; Tue, 23 Jan 2018 23:16:46 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1edxVN-0007gB-8D; Tue, 23 Jan 2018 12:16:45 +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 1edxVK-0007fn-D0 for fwts-devel@lists.ubuntu.com; Tue, 23 Jan 2018 12:16:42 +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 1edxVK-0005Kq-3r; Tue, 23 Jan 2018 12:16:42 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] opal: reserve_mem: remove unused variable 'i' and move scope of variable 'value' Date: Tue, 23 Jan 2018 12:16:41 +0000 Message-Id: <20180123121641.20689-1-colin.king@canonical.com> X-Mailer: git-send-email 2.15.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 Minor code cleanups; variable i is assiged but never read, so it can be removed. Move the scope of variable value into the while loop. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/opal/reserv_mem.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/opal/reserv_mem.c b/src/opal/reserv_mem.c index f31e9652..4683f73c 100644 --- a/src/opal/reserv_mem.c +++ b/src/opal/reserv_mem.c @@ -57,9 +57,7 @@ static int get_config(fwts_framework *fw, { FILE *file; char *p; - uint64_t value; char line[MAXBUF]; - int i = 0; file = fopen(filename, "r"); if (!file) { @@ -71,6 +69,7 @@ static int get_config(fwts_framework *fw, while (fgets(line, sizeof(line), file) != NULL) { char *cfline; + uint64_t value; cfline = strstr((char *)line, DELIM); cfline = cfline + strlen(DELIM); @@ -82,8 +81,6 @@ static int get_config(fwts_framework *fw, configstruct->occ_common = value; else if (strstr(line, "slw-image")) configstruct->slw = value; - - i++; } fclose(file);