public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Tan, Dun" <dun.tan@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Liming Gao <gaoliming@byosoft.com.cn>,
	"Wu, Jiaxin" <jiaxin.wu@intel.com>
Subject: Re: [edk2-devel] [PATCH 6/9] MdeModulePkg:Remove unnecessary global variable
Date: Fri, 17 May 2024 12:07:27 +0000	[thread overview]
Message-ID: <MN6PR11MB8244C31E9F5F493B37EA2A458CEE2@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20240517094917.513-7-dun.tan@intel.com>

[-- Attachment #1: Type: text/plain, Size: 4026 bytes --]

Reviewed-by: Ray Ni <ray.ni@intel.com>

Thanks,
Ray
________________________________
From: Tan, Dun <dun.tan@intel.com>
Sent: Friday, May 17, 2024 17:49
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Ni, Ray <ray.ni@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [PATCH 6/9] MdeModulePkg:Remove unnecessary global variable

Remove the two unnecessary global variables and
replace them by two local variables:
mVariableRuntimeNvCacheBufferSize
mVariableRuntimeVolatileCacheBufferSize

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
---
 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.<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)) {
--
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119045): https://edk2.groups.io/g/devel/message/119045
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]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 8407 bytes --]

  reply	other threads:[~2024-05-17 12:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17  9:49 [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI duntan
2024-05-17  9:49 ` [edk2-devel] [PATCH 1/9] MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid duntan
2024-05-17 11:49   ` Ni, Ray
2024-05-17  9:49 ` [edk2-devel] [PATCH 2/9] ArmVirtPkg: Add MmUnblockMemoryLib in DSC duntan
2024-05-17 11:50   ` Ni, Ray
2024-05-17  9:49 ` [edk2-devel] [PATCH 3/9] EmulatorPkg: " duntan
2024-05-17 11:54   ` Ni, Ray
2024-05-17  9:49 ` [edk2-devel] [PATCH 4/9] OvmfPkg: " duntan
2024-05-17 11:55   ` Ni, Ray
2024-05-17  9:49 ` [edk2-devel] [PATCH 5/9] MdeModulePkg:Create gEdkiiVariableRuntimeCacheInfoHobGuid duntan
2024-05-17 12:02   ` Ni, Ray
2024-05-17  9:49 ` [edk2-devel] [PATCH 6/9] MdeModulePkg:Remove unnecessary global variable duntan
2024-05-17 12:07   ` Ni, Ray [this message]
2024-05-17  9:49 ` [edk2-devel] [PATCH 7/9] MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid duntan
2024-05-17 12:09   ` Ni, Ray
2024-05-17 17:09     ` Kun Qin via groups.io
2024-05-20  7:07       ` Ni, Ray
2024-05-22  1:30         ` Kenneth Lautner
2024-05-17 12:17   ` Ni, Ray
2024-05-17  9:49 ` [edk2-devel] [PATCH 8/9] MdeModulePkg: Refine InitVariableCache() duntan
2024-05-17  9:49 ` [edk2-devel] [PATCH 9/9] MdeModulePkg:Add global variable mVariableRtCacheInfo duntan
2024-05-17 12:30   ` Ni, Ray
2024-05-20  1:01 ` [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI Nhi Pham via groups.io
2024-05-20  6:54   ` Ni, Ray
2024-05-20  1:40 ` 回复: " gaoliming via groups.io
2024-05-20  7:12   ` duntan
2024-05-20 18:16 ` Sean
2024-05-21  9:25   ` duntan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN6PR11MB8244C31E9F5F493B37EA2A458CEE2@MN6PR11MB8244.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox