]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/FirmwareVolume/UpdateDriverDxe/UpdateDispatcher.c
IntelFrameworkModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / FirmwareVolume / UpdateDriverDxe / UpdateDispatcher.c
index 99b8d3c3588886e6042dfc2a457be5f8e8fd3f65..aaab24921df1f86abd815429bd1e7f757ecc688c 100644 (file)
@@ -3,16 +3,9 @@
   for the image to be programmed, and the flash area that is going to be\r
   programed.\r
 \r
-  Copyright (c) 2002 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2002 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions\r
-  of the BSD License which accompanies this distribution.  The\r
-  full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -22,7 +15,7 @@ EFI_HII_HANDLE  gHiiHandle;
 \r
 /**\r
   Update the whole FV, or certain files in the FV.\r
-  \r
+\r
   @param ConfigData      Pointer to the config data on updating file.\r
   @param ImageBuffer     Image buffer to be updated.\r
   @param ImageSize       Image size.\r
@@ -89,7 +82,7 @@ PerformUpdateOnFirmwareVolume (
     //\r
     Status = FvbProtocol->GetAttributes (FvbProtocol, &Attributes);\r
     if (EFI_ERROR (Status) || ((Attributes & EFI_FVB2_WRITE_STATUS) == 0)) {\r
-      continue;     \r
+      continue;\r
     }\r
 \r
     Status            = FvbProtocol->GetPhysicalAddress (\r
@@ -197,7 +190,7 @@ PerformUpdateOnFlashArea (
     Print (TmpStr, FlashAddress, ((UINT64)SizeLeft + FlashAddress));\r
     FreePool (TmpStr);\r
   }\r
-  \r
+\r
   //\r
   // Locate all Fvb protocol\r
   //\r
@@ -242,7 +235,7 @@ PerformUpdateOnFlashArea (
       //\r
       Status = FvbProtocol->GetAttributes (FvbProtocol, &Attributes);\r
       if (EFI_ERROR (Status) || ((Attributes & EFI_FVB2_WRITE_STATUS) == 0)) {\r
-        continue;     \r
+        continue;\r
       }\r
 \r
       Status        = FvbProtocol->GetPhysicalAddress (\r
@@ -326,7 +319,7 @@ PerformUpdateOnFlashArea (
     if (EFI_ERROR (Status)) {\r
       return Status;\r
     }\r
\r
+\r
     //\r
     // Check if we are done with the update\r
     //\r
@@ -540,7 +533,7 @@ ProcessUpdateImage (
   FvAlignment = 1 << ((FwVolHeader->Attributes & EFI_FVB2_ALIGNMENT) >> 16);\r
   //\r
   // FvAlignment must be greater than or equal to 8 bytes of the minimum FFS alignment value.\r
-  // \r
+  //\r
   if (FvAlignment < 8) {\r
     FvAlignment = 8;\r
   }\r
@@ -583,7 +576,7 @@ ProcessUpdateImage (
 /**\r
   Find the image in the same FV and program it in a target Firmware Volume device.\r
   After update image, it will reset system and no return.\r
-  \r
+\r
   @param ImageHandle   A handle for the image that is initializing this driver\r
   @param SystemTable   A pointer to the EFI system table\r
 \r
@@ -602,7 +595,7 @@ InitializeUpdateDriver (
   EFI_LOADED_IMAGE_PROTOCOL             *LoadedImageProtocol;\r
   EFI_FIRMWARE_VOLUME2_PROTOCOL         *FwVolProtocol;\r
   EFI_FIRMWARE_VOLUME2_PROTOCOL         *DataFwVolProtocol;\r
-  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH     *FwVolFilePathNode; \r
+  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH     *FwVolFilePathNode;\r
   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH     *AlignedDevPathNode;\r
   EFI_DEVICE_PATH_PROTOCOL              *FilePathNode;\r
   EFI_SECTION_TYPE                      SectionType;\r
@@ -755,6 +748,7 @@ InitializeUpdateDriver (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+  ASSERT (ConfigData != NULL);\r
 \r
   //\r
   // Now find the update image. The update image should be put in a FV, and then\r
@@ -814,7 +808,7 @@ InitializeUpdateDriver (
                UpdateConfigData\r
                );\r
     //\r
-    // Shall updates be serialized so that if an update is not successfully completed, \r
+    // Shall updates be serialized so that if an update is not successfully completed,\r
     // the remaining updates won't be performed.\r
     //\r
     if (EFI_ERROR (Status)) {\r