summaryrefslogtreecommitdiff
path: root/FmpDevicePkg/FmpDxe
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-07-30 17:47:57 +0800
committerKinney, Michael D <michael.d.kinney@intel.com>2018-08-02 14:46:19 -0700
commita6d73269b134116cfb84830d81f5ac2a389eb91b (patch)
treeccedb43710017665d3b2eba0330aa7729f11939c /FmpDevicePkg/FmpDxe
parent559b5d5283ac6c0890b35e8684963e35f57f79b9 (diff)
downloadedk2-a6d73269b134116cfb84830d81f5ac2a389eb91b.zip
edk2-a6d73269b134116cfb84830d81f5ac2a389eb91b.tar.gz
edk2-a6d73269b134116cfb84830d81f5ac2a389eb91b.tar.bz2
FmpDevicePkg: Fix code style issue
Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'FmpDevicePkg/FmpDxe')
-rw-r--r--FmpDevicePkg/FmpDxe/DetectTestKey.c2
-rw-r--r--FmpDevicePkg/FmpDxe/FmpDxe.c42
-rw-r--r--FmpDevicePkg/FmpDxe/VariableSupport.c6
-rw-r--r--FmpDevicePkg/FmpDxe/VariableSupport.h6
4 files changed, 29 insertions, 27 deletions
diff --git a/FmpDevicePkg/FmpDxe/DetectTestKey.c b/FmpDevicePkg/FmpDxe/DetectTestKey.c
index 0a6e37e..6dedbdf 100644
--- a/FmpDevicePkg/FmpDxe/DetectTestKey.c
+++ b/FmpDevicePkg/FmpDxe/DetectTestKey.c
@@ -1,4 +1,4 @@
-/** @file
+/** @file
Detects if PcdFmpDevicePkcs7CertBufferXdr contains a test key.
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index 095ceba..0f3396c 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -1,4 +1,4 @@
-/** @file
+/** @file
Produces a Firmware Management Protocol that supports updates to a firmware
image stored in a firmware device with platform and firmware device specific
information provided through PCDs and libraries.
@@ -90,7 +90,7 @@ CHAR16 *mVersionName = NULL;
EFI_EVENT mFmpDeviceLockEvent;
//
-// Indicates if an attempt has been made to lock a
+// Indicates if an attempt has been made to lock a
// FLASH storage device by calling FmpDeviceLock().
// A FLASH storage device may not support being locked,
// so this variable is set to TRUE even if FmpDeviceLock()
@@ -474,11 +474,11 @@ cleanup:
This function allows a copy of the current firmware image to be created and saved.
The saved copy could later been used, for example, in firmware image recovery or rollback.
- @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.
- @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.
+ @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.
+ @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.
The number is between 1 and DescriptorCount.
- @param[out] Image Points to the buffer where the current image is copied to.
- @param[out] ImageSize On entry, points to the size of the buffer pointed to by Image, in bytes.
+ @param[in, out] Image Points to the buffer where the current image is copied to.
+ @param[in, out] ImageSize On entry, points to the size of the buffer pointed to by Image, in bytes.
On return, points to the length of the image, in bytes.
@retval EFI_SUCCESS The device was successfully updated with the new image.
@@ -646,7 +646,7 @@ CheckTheImage (
IN UINT8 ImageIndex,
IN CONST VOID *Image,
IN UINTN ImageSize,
- OUT UINT32 *ImageUpdateable
+ OUT UINT32 *ImageUpdatable
)
{
EFI_STATUS Status;
@@ -677,8 +677,8 @@ CheckTheImage (
PopulateDescriptor();
}
- if (ImageUpdateable == NULL) {
- DEBUG ((DEBUG_ERROR, "FmpDxe: CheckImage() - ImageUpdateable Pointer Parameter is NULL.\n"));
+ if (ImageUpdatable == NULL) {
+ DEBUG ((DEBUG_ERROR, "FmpDxe: CheckImage() - ImageUpdatable Pointer Parameter is NULL.\n"));
Status = EFI_INVALID_PARAMETER;
goto cleanup;
}
@@ -686,14 +686,14 @@ CheckTheImage (
//
//Set to valid and then if any tests fail it will update this flag.
//
- *ImageUpdateable = IMAGE_UPDATABLE_VALID;
+ *ImageUpdatable = IMAGE_UPDATABLE_VALID;
if (Image == NULL) {
DEBUG ((DEBUG_ERROR, "FmpDxe: CheckImage() - Image Pointer Parameter is NULL.\n"));
//
// not sure if this is needed
//
- *ImageUpdateable = IMAGE_UPDATABLE_INVALID;
+ *ImageUpdatable = IMAGE_UPDATABLE_INVALID;
return EFI_INVALID_PARAMETER;
}
@@ -767,7 +767,7 @@ CheckTheImage (
//
if (ImageIndex != 1) {
DEBUG ((DEBUG_ERROR, "FmpDxe: CheckImage() - Image Index Invalid.\n"));
- *ImageUpdateable = IMAGE_UPDATABLE_INVALID_TYPE;
+ *ImageUpdatable = IMAGE_UPDATABLE_INVALID_TYPE;
Status = EFI_SUCCESS;
goto cleanup;
}
@@ -785,7 +785,7 @@ CheckTheImage (
Status = GetFmpPayloadHeaderVersion (FmpPayloadHeader, FmpPayloadSize, &Version);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "FmpDxe: CheckTheImage() - GetFmpPayloadHeaderVersion failed %r.\n", Status));
- *ImageUpdateable = IMAGE_UPDATABLE_INVALID;
+ *ImageUpdatable = IMAGE_UPDATABLE_INVALID;
Status = EFI_SUCCESS;
goto cleanup;
}
@@ -799,7 +799,7 @@ CheckTheImage (
"FmpDxe: CheckTheImage() - Version Lower than lowest supported version. 0x%08X < 0x%08X\n",
Version, mDesc.LowestSupportedImageVersion)
);
- *ImageUpdateable = IMAGE_UPDATABLE_INVALID_OLD;
+ *ImageUpdatable = IMAGE_UPDATABLE_INVALID_OLD;
Status = EFI_SUCCESS;
goto cleanup;
}
@@ -810,7 +810,7 @@ CheckTheImage (
Status = GetFmpPayloadHeaderSize (FmpPayloadHeader, FmpPayloadSize, &FmpHeaderSize);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "FmpDxe: CheckTheImage() - GetFmpPayloadHeaderSize failed %r.\n", Status));
- *ImageUpdateable = IMAGE_UPDATABLE_INVALID;
+ *ImageUpdatable = IMAGE_UPDATABLE_INVALID;
Status = EFI_SUCCESS;
goto cleanup;
}
@@ -830,7 +830,7 @@ CheckTheImage (
//
// FmpDeviceLib CheckImage function to do any specific checks
//
- Status = FmpDeviceCheckImage ((((UINT8 *)Image) + AllHeaderSize), RawSize, ImageUpdateable);
+ Status = FmpDeviceCheckImage ((((UINT8 *)Image) + AllHeaderSize), RawSize, ImageUpdatable);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "FmpDxe: CheckTheImage() - FmpDeviceLib CheckImage failed. Status = %r\n", Status));
}
@@ -909,6 +909,8 @@ SetTheImage (
EFI_STATUS GetAttributesStatus;
UINT64 AttributesSupported;
UINT64 AttributesSetting;
+ UINT32 Version;
+ UINT32 LowestSupportedVersion;
Status = EFI_SUCCESS;
Updateable = 0;
@@ -1103,7 +1105,7 @@ SetTheImage (
// Update the version stored in variable
//
if (!mRuntimeVersionSupported) {
- UINT32 Version = DEFAULT_VERSION;
+ Version = DEFAULT_VERSION;
GetFmpPayloadHeaderVersion (FmpHeader, FmpPayloadSize, &Version);
SetVersionInVariable (Version);
}
@@ -1112,9 +1114,9 @@ SetTheImage (
// Update lowest supported variable
//
{
- UINT32 Version = DEFAULT_LOWESTSUPPORTEDVERSION;
- GetFmpPayloadHeaderLowestSupportedVersion (FmpHeader, FmpPayloadSize, &Version);
- SetLowestSupportedVersionInVariable (Version);
+ LowestSupportedVersion = DEFAULT_LOWESTSUPPORTEDVERSION;
+ GetFmpPayloadHeaderLowestSupportedVersion (FmpHeader, FmpPayloadSize, &LowestSupportedVersion);
+ SetLowestSupportedVersionInVariable (LowestSupportedVersion);
}
LastAttemptStatus = LAST_ATTEMPT_STATUS_SUCCESS;
diff --git a/FmpDevicePkg/FmpDxe/VariableSupport.c b/FmpDevicePkg/FmpDxe/VariableSupport.c
index 6a4330a..b7e4cb9 100644
--- a/FmpDevicePkg/FmpDxe/VariableSupport.c
+++ b/FmpDevicePkg/FmpDxe/VariableSupport.c
@@ -1,4 +1,4 @@
-/** @file
+/** @file
UEFI variable support functions for Firmware Management Protocol based
firmware updates.
@@ -305,8 +305,8 @@ SetVersionInVariable (
UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"FmpLsv"
- @param[in] LowestSupported The lowest supported version of the firmware image
- in the firmware device.
+ @param[in] LowestSupportedVersion The lowest supported version of the firmware image
+ in the firmware device.
**/
VOID
diff --git a/FmpDevicePkg/FmpDxe/VariableSupport.h b/FmpDevicePkg/FmpDxe/VariableSupport.h
index e7e34f5..62c213e 100644
--- a/FmpDevicePkg/FmpDxe/VariableSupport.h
+++ b/FmpDevicePkg/FmpDxe/VariableSupport.h
@@ -1,4 +1,4 @@
-/** @file
+/** @file
UEFI variable support functions for Firmware Management Protocol based
firmware updates.
@@ -128,8 +128,8 @@ SetVersionInVariable (
UEFI Variable accessed: GUID = gEfiCallerIdGuid, Name = L"FmpLsv"
- @param[in] LowestSupported The lowest supported version of the firmware image
- in the firmware device.
+ @param[in] LowestSupportedVersion The lowest supported version of the firmware image
+ in the firmware device.
**/
VOID