diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:53:52 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 2b16a4fb91b9b31c0d152588f5ac51080c6c0763 (patch) | |
tree | 72c352a8e807a4720c1675a755969206c6370588 /ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c | |
parent | 40b0b23ed34f48c26d711d3e4613a4bb35eeadff (diff) | |
download | edk2-2b16a4fb91b9b31c0d152588f5ac51080c6c0763.zip edk2-2b16a4fb91b9b31c0d152588f5ac51080c6c0763.tar.gz edk2-2b16a4fb91b9b31c0d152588f5ac51080c6c0763.tar.bz2 |
ArmVirtPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the ArmVirtPkg package
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c')
-rw-r--r-- | ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c | 85 |
1 files changed, 55 insertions, 30 deletions
diff --git a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c index 271d7f0..2b39f02 100644 --- a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c +++ b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c @@ -13,9 +13,9 @@ #include <Protocol/FdtClient.h>
-#define QEMU_NOR_BLOCK_SIZE SIZE_256KB
+#define QEMU_NOR_BLOCK_SIZE SIZE_256KB
-#define MAX_FLASH_BANKS 4
+#define MAX_FLASH_BANKS 4
EFI_STATUS
NorFlashPlatformInitialization (
@@ -25,40 +25,59 @@ NorFlashPlatformInitialization ( return EFI_SUCCESS;
}
-NOR_FLASH_DESCRIPTION mNorFlashDevices[MAX_FLASH_BANKS];
+NOR_FLASH_DESCRIPTION mNorFlashDevices[MAX_FLASH_BANKS];
EFI_STATUS
NorFlashPlatformGetDevices (
- OUT NOR_FLASH_DESCRIPTION **NorFlashDescriptions,
- OUT UINT32 *Count
+ OUT NOR_FLASH_DESCRIPTION **NorFlashDescriptions,
+ OUT UINT32 *Count
)
{
- FDT_CLIENT_PROTOCOL *FdtClient;
- INT32 Node;
- EFI_STATUS Status;
- EFI_STATUS FindNodeStatus;
- CONST UINT32 *Reg;
- UINT32 PropSize;
- UINT32 Num;
- UINT64 Base;
- UINT64 Size;
-
- Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,
- (VOID **)&FdtClient);
+ FDT_CLIENT_PROTOCOL *FdtClient;
+ INT32 Node;
+ EFI_STATUS Status;
+ EFI_STATUS FindNodeStatus;
+ CONST UINT32 *Reg;
+ UINT32 PropSize;
+ UINT32 Num;
+ UINT64 Base;
+ UINT64 Size;
+
+ Status = gBS->LocateProtocol (
+ &gFdtClientProtocolGuid,
+ NULL,
+ (VOID **)&FdtClient
+ );
ASSERT_EFI_ERROR (Status);
Num = 0;
- for (FindNodeStatus = FdtClient->FindCompatibleNode (FdtClient,
- "cfi-flash", &Node);
+ for (FindNodeStatus = FdtClient->FindCompatibleNode (
+ FdtClient,
+ "cfi-flash",
+ &Node
+ );
!EFI_ERROR (FindNodeStatus) && Num < MAX_FLASH_BANKS;
- FindNodeStatus = FdtClient->FindNextCompatibleNode (FdtClient,
- "cfi-flash", Node, &Node)) {
-
- Status = FdtClient->GetNodeProperty (FdtClient, Node, "reg",
- (CONST VOID **)&Reg, &PropSize);
+ FindNodeStatus = FdtClient->FindNextCompatibleNode (
+ FdtClient,
+ "cfi-flash",
+ Node,
+ &Node
+ ))
+ {
+ Status = FdtClient->GetNodeProperty (
+ FdtClient,
+ Node,
+ "reg",
+ (CONST VOID **)&Reg,
+ &PropSize
+ );
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: GetNodeProperty () failed (Status == %r)\n",
- __FUNCTION__, Status));
+ DEBUG ((
+ DEBUG_ERROR,
+ "%a: GetNodeProperty () failed (Status == %r)\n",
+ __FUNCTION__,
+ Status
+ ));
continue;
}
@@ -76,7 +95,8 @@ NorFlashPlatformGetDevices ( // The firmware is not updatable from inside the guest anyway.
//
if ((PcdGet64 (PcdFvBaseAddress) + PcdGet32 (PcdFvSize) > Base) &&
- (Base + Size) > PcdGet64 (PcdFvBaseAddress)) {
+ ((Base + Size) > PcdGet64 (PcdFvBaseAddress)))
+ {
continue;
}
@@ -97,15 +117,20 @@ NorFlashPlatformGetDevices ( // code, which is not intended to be guest updatable, and is usually backed
// in a readonly manner by QEMU anyway.
//
- Status = FdtClient->SetNodeProperty (FdtClient, Node, "status",
- "disabled", sizeof ("disabled"));
+ Status = FdtClient->SetNodeProperty (
+ FdtClient,
+ Node,
+ "status",
+ "disabled",
+ sizeof ("disabled")
+ );
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_WARN, "Failed to set NOR flash status to 'disabled'\n"));
}
}
*NorFlashDescriptions = mNorFlashDevices;
- *Count = Num;
+ *Count = Num;
return EFI_SUCCESS;
}
|