From patchwork Wed Sep 22 10:40:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1531183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=fW0vuNy5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HDvvS40Z8z9sW4 for ; Wed, 22 Sep 2021 20:40:20 +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 1mSzfk-00022r-Jx; Wed, 22 Sep 2021 10:40:16 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mSzfk-00022l-0R for fwts-devel@lists.ubuntu.com; Wed, 22 Sep 2021 10:40:16 +0000 Received: from localhost (1.general.cking.uk.vpn [10.172.193.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id BFBCD40197; Wed, 22 Sep 2021 10:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632307215; bh=4o26yj20psWNDZUdnPd4chcuoRQRbN9/aQsjuJOJlVU=; h=From:To:Subject:Date:Message-Id:MIME-Version:Content-Type; b=fW0vuNy5OPNeWn4dxtdhxYuuzRc0/7joeiJ0lZXxIx4nGzcViHav6cNpvGrRj+zDZ QxlMvncPqUMZixyIQhaxOe02vgD16rTIhtJ5DMkasCMfQUOhtvVbz8p9DrcNB+iRJ5 Qq1XuDfBpHNr9UZmnW1ujSe/+NiEXxOgHDdRyOmZG/CDUEK+Ln+p6oWn9Cz5hlDsra cHzfcRovzTe5O6xhTui0nXCNitBYqtbPa3nXhbxRohDgd7A6ugfqsUOF0Bf+JaaHaT o6Gud4oa/6M7iLvr9odxchD6qbwafwIPvKZxPvwyzbSrnNmhbVob7u/e94u2ICQTqe jddDhYAoEdDrA== From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] uefi: uefirtmisc: reduce scope of some variables Date: Wed, 22 Sep 2021 11:40:15 +0100 Message-Id: <20210922104015.179242-1-colin.king@canonical.com> X-Mailer: git-send-email 2.32.0 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 Several variables are used in a deeper scope, move these to clean up cppcheck style warnings. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/uefi/uefirtmisc/uefirtmisc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c index c00ed442..f6038f5f 100644 --- a/src/uefi/uefirtmisc/uefirtmisc.c +++ b/src/uefi/uefirtmisc/uefirtmisc.c @@ -281,12 +281,13 @@ static int uefirtmisc_test3(fwts_framework *fw) static int uefirtmisc_test4(fwts_framework *fw) { - long ioret; - uint64_t status; - struct efi_getnexthighmonotoniccount getnexthighmonotoniccount; - uint32_t highcount; if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT)) { + long ioret; + uint64_t status; + struct efi_getnexthighmonotoniccount getnexthighmonotoniccount; + uint32_t highcount; + getnexthighmonotoniccount.HighCount = &highcount; getnexthighmonotoniccount.status = &status; status = ~0ULL;