From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 17761D80F81 for ; Fri, 17 May 2024 09:49:47 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=iX1EfJa2aZxbPvFv6j6PR1Xy6l3AZJKWjJ010iBmqAI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1715939386; v=1; b=lVkJVW1+IJSDFuS++i9OoEAZ5inrSFIWbbttOhHb+mSmO5MxWQba5FdYrOQLtqgqIfd1Hebl 6rDBQe0iydLiezfajGhvVJyjBFkmdRj6HZ9O78TB+3cLHSKdIBhyvgqThyAaZF3hqrJYvsA9ozd PjwUXNQ9hc0ZmBfHavKJle41qSGdQDqo+uisZ+60LpJB3xvYm7wvN6Q8oEsWAT1ns/9mmEnzNst pKHdQsIj1wZyz94eL57GGkVLOCgL/0u5C/g7z70IA4SWY/TitVuA6Z34dgTvdkn+Dbqb9XQygkb EzsGUvl2HZeo/ZBl3eVTD+llx2sszHXBcMLGYiJv6WrWQ== X-Received: by 127.0.0.2 with SMTP id 7WONYY7687511xQpiNI8hULP; Fri, 17 May 2024 02:49:46 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by mx.groups.io with SMTP id smtpd.web10.36016.1715939370910548931 for ; Fri, 17 May 2024 02:49:46 -0700 X-CSE-ConnectionGUID: BVAqkJ5vR7mzSlh2xibwWQ== X-CSE-MsgGUID: AuNN/yqhSj+WS9OGrjaIKA== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11570303" X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="11570303" X-Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 02:49:46 -0700 X-CSE-ConnectionGUID: kG8NpigwROG9fW11K8RBIw== X-CSE-MsgGUID: iR2ju+X4Q+mQUgskCRrQbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,167,1712646000"; d="scan'208";a="31739288" X-Received: from unknown (HELO shwdeopenlab702.ccr.corp.intel.com) ([10.239.55.43]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 02:49:45 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Ray Ni , Liming Gao , Jiaxin Wu Subject: [edk2-devel] [PATCH 6/9] MdeModulePkg:Remove unnecessary global variable Date: Fri, 17 May 2024 17:49:14 +0800 Message-Id: <20240517094917.513-7-dun.tan@intel.com> In-Reply-To: <20240517094917.513-1-dun.tan@intel.com> References: <20240517094917.513-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 17 May 2024 02:49:46 -0700 Resent-From: dun.tan@intel.com Reply-To: devel@edk2.groups.io,dun.tan@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ChJs2xWLjXi1xlYDfrBNzinUx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=lVkJVW1+; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) Remove the two unnecessary global variables and replace them by two local variables: mVariableRuntimeNvCacheBufferSize mVariableRuntimeVolatileCacheBufferSize Signed-off-by: Dun Tan Cc: Ray Ni Cc: Liming Gao Cc: Jiaxin Wu --- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c index 6930875e9f..8b42ae7d72 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -13,7 +13,7 @@ InitCommunicateBuffer() is really function to check the variable data size. -Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -55,8 +55,6 @@ VARIABLE_STORE_HEADER *mVariableRuntimeNvCacheBuffer = NULL; VARIABLE_STORE_HEADER *mVariableRuntimeVolatileCacheBuffer = NULL; UINTN mVariableBufferSize; UINTN mVariableRuntimeHobCacheBufferSize; -UINTN mVariableRuntimeNvCacheBufferSize; -UINTN mVariableRuntimeVolatileCacheBufferSize; UINTN mVariableBufferPayloadSize; BOOLEAN mVariableRuntimeCachePendingUpdate; BOOLEAN mVariableRuntimeCacheReadLock; @@ -1691,6 +1689,8 @@ SmmVariableReady ( ) { EFI_STATUS Status; + UINTN RuntimeNvCacheSize; + UINTN RuntimeVolatileCacheSize; Status = gBS->LocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOID **)&mSmmVariable); if (EFI_ERROR (Status)) { @@ -1721,16 +1721,16 @@ SmmVariableReady ( // Status = GetRuntimeCacheInfo ( &mVariableRuntimeHobCacheBufferSize, - &mVariableRuntimeNvCacheBufferSize, - &mVariableRuntimeVolatileCacheBufferSize, + &RuntimeNvCacheSize, + &RuntimeVolatileCacheSize, &mVariableAuthFormat ); if (!EFI_ERROR (Status)) { Status = InitVariableCache (&mVariableRuntimeHobCacheBuffer, &mVariableRuntimeHobCacheBufferSize); if (!EFI_ERROR (Status)) { - Status = InitVariableCache (&mVariableRuntimeNvCacheBuffer, &mVariableRuntimeNvCacheBufferSize); + Status = InitVariableCache (&mVariableRuntimeNvCacheBuffer, &RuntimeNvCacheSize); if (!EFI_ERROR (Status)) { - Status = InitVariableCache (&mVariableRuntimeVolatileCacheBuffer, &mVariableRuntimeVolatileCacheBufferSize); + Status = InitVariableCache (&mVariableRuntimeVolatileCacheBuffer, &RuntimeVolatileCacheSize); if (!EFI_ERROR (Status)) { Status = SendRuntimeVariableCacheContextToSmm (); if (!EFI_ERROR (Status)) { -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119023): https://edk2.groups.io/g/devel/message/119023 Mute This Topic: https://groups.io/mt/106150803/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-