]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.c
Fix GCC warnings
[mirror_edk2.git] / MdeModulePkg / Universal / FaultTolerantWriteDxe / FaultTolerantWrite.c
index e0ac6ee17c87e2da01d33a71285f8670c130b736..15a12d70fedc2c76f9b3c5dc748767d9757839fa 100644 (file)
@@ -863,6 +863,14 @@ FtwGetLastWrite (
   return Status;\r
 }\r
 \r
+/**\r
+  Firmware Volume Block Protocol notification event handler.\r
+\r
+  Initialization for Fault Tolerant Write is done in this handler.\r
+\r
+  @param[in] Event    Event whose notification function is being invoked.\r
+  @param[in] Context  Pointer to the notification function's context.\r
+**/\r
 VOID\r
 EFIAPI\r
 FvbNotificationEvent (\r
@@ -890,6 +898,9 @@ FvbNotificationEvent (
   FvbHandle = NULL;\r
   Fvb       = NULL;\r
 \r
+  FtwDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwWorkingBase);\r
+  FtwDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwSpareBase);\r
+\r
   //\r
   // Locate all handles of Fvb protocol\r
   //\r
@@ -1204,10 +1215,8 @@ InitializeFaultTolerantWrite (
   // Initialize other parameters, and set WorkSpace as FTW_ERASED_BYTE.\r
   //\r
 \r
-  FtwDevice->WorkSpaceAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwWorkingBase);\r
   FtwDevice->WorkSpaceLength  = (UINTN) PcdGet32 (PcdFlashNvStorageFtwWorkingSize);\r
 \r
-  FtwDevice->SpareAreaAddress = (EFI_PHYSICAL_ADDRESS) PcdGet32 (PcdFlashNvStorageFtwSpareBase);\r
   FtwDevice->SpareAreaLength  = (UINTN) PcdGet32 (PcdFlashNvStorageFtwSpareSize);\r
 \r
   if ((FtwDevice->WorkSpaceLength == 0) || (FtwDevice->SpareAreaLength == 0)) {\r