summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDun Tan <dun.tan@intel.com>2024-05-14 12:13:15 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-06-17 13:42:43 +0000
commit645d9f6f8d221802dc9cdf22b05139b593817507 (patch)
treea6632c55127d42a4ec3d96734076a496041f8744
parentd8f513de3e3ef228af7e6facf0ad3e35c3224032 (diff)
downloadedk2-645d9f6f8d221802dc9cdf22b05139b593817507.zip
edk2-645d9f6f8d221802dc9cdf22b05139b593817507.tar.gz
edk2-645d9f6f8d221802dc9cdf22b05139b593817507.tar.bz2
MdeModulePkg:Remove unnecessary global variables
Remove the two unnecessary global variables and replace them by two local variables: mVariableRuntimeNvCacheBufferSize mVariableRuntimeVolatileCacheBufferSize Signed-off-by: Dun Tan <dun.tan@intel.com>
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
index 6930875..8b42ae7 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.<BR>
+Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR>
Copyright (c) Microsoft Corporation.<BR>
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)) {