]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
ArmVirtPkg: Apply uncrustify changes
[mirror_edk2.git] / ArmVirtPkg / Library / NorFlashQemuLib / NorFlashQemuLib.c
index 271d7f0efbc09e9848608b6fc3de55d600c905cb..2b39f021d0aec8a94ab5ebe63a0ebaef877160c0 100644 (file)
@@ -13,9 +13,9 @@
 \r
 #include <Protocol/FdtClient.h>\r
 \r
-#define QEMU_NOR_BLOCK_SIZE    SIZE_256KB\r
+#define QEMU_NOR_BLOCK_SIZE  SIZE_256KB\r
 \r
-#define MAX_FLASH_BANKS        4\r
+#define MAX_FLASH_BANKS  4\r
 \r
 EFI_STATUS\r
 NorFlashPlatformInitialization (\r
@@ -25,40 +25,59 @@ NorFlashPlatformInitialization (
   return EFI_SUCCESS;\r
 }\r
 \r
-NOR_FLASH_DESCRIPTION mNorFlashDevices[MAX_FLASH_BANKS];\r
+NOR_FLASH_DESCRIPTION  mNorFlashDevices[MAX_FLASH_BANKS];\r
 \r
 EFI_STATUS\r
 NorFlashPlatformGetDevices (\r
-  OUT NOR_FLASH_DESCRIPTION   **NorFlashDescriptions,\r
-  OUT UINT32                  *Count\r
+  OUT NOR_FLASH_DESCRIPTION  **NorFlashDescriptions,\r
+  OUT UINT32                 *Count\r
   )\r
 {\r
-  FDT_CLIENT_PROTOCOL         *FdtClient;\r
-  INT32                       Node;\r
-  EFI_STATUS                  Status;\r
-  EFI_STATUS                  FindNodeStatus;\r
-  CONST UINT32                *Reg;\r
-  UINT32                      PropSize;\r
-  UINT32                      Num;\r
-  UINT64                      Base;\r
-  UINT64                      Size;\r
-\r
-  Status = gBS->LocateProtocol (&gFdtClientProtocolGuid, NULL,\r
-                  (VOID **)&FdtClient);\r
+  FDT_CLIENT_PROTOCOL  *FdtClient;\r
+  INT32                Node;\r
+  EFI_STATUS           Status;\r
+  EFI_STATUS           FindNodeStatus;\r
+  CONST UINT32         *Reg;\r
+  UINT32               PropSize;\r
+  UINT32               Num;\r
+  UINT64               Base;\r
+  UINT64               Size;\r
+\r
+  Status = gBS->LocateProtocol (\r
+                  &gFdtClientProtocolGuid,\r
+                  NULL,\r
+                  (VOID **)&FdtClient\r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   Num = 0;\r
-  for (FindNodeStatus = FdtClient->FindCompatibleNode (FdtClient,\r
-                                     "cfi-flash", &Node);\r
+  for (FindNodeStatus = FdtClient->FindCompatibleNode (\r
+                                     FdtClient,\r
+                                     "cfi-flash",\r
+                                     &Node\r
+                                     );\r
        !EFI_ERROR (FindNodeStatus) && Num < MAX_FLASH_BANKS;\r
-       FindNodeStatus = FdtClient->FindNextCompatibleNode (FdtClient,\r
-                                     "cfi-flash", Node, &Node)) {\r
-\r
-    Status = FdtClient->GetNodeProperty (FdtClient, Node, "reg",\r
-                          (CONST VOID **)&Reg, &PropSize);\r
+       FindNodeStatus = FdtClient->FindNextCompatibleNode (\r
+                                     FdtClient,\r
+                                     "cfi-flash",\r
+                                     Node,\r
+                                     &Node\r
+                                     ))\r
+  {\r
+    Status = FdtClient->GetNodeProperty (\r
+                          FdtClient,\r
+                          Node,\r
+                          "reg",\r
+                          (CONST VOID **)&Reg,\r
+                          &PropSize\r
+                          );\r
     if (EFI_ERROR (Status)) {\r
-      DEBUG ((DEBUG_ERROR, "%a: GetNodeProperty () failed (Status == %r)\n",\r
-        __FUNCTION__, Status));\r
+      DEBUG ((\r
+        DEBUG_ERROR,\r
+        "%a: GetNodeProperty () failed (Status == %r)\n",\r
+        __FUNCTION__,\r
+        Status\r
+        ));\r
       continue;\r
     }\r
 \r
@@ -76,7 +95,8 @@ NorFlashPlatformGetDevices (
       // The firmware is not updatable from inside the guest anyway.\r
       //\r
       if ((PcdGet64 (PcdFvBaseAddress) + PcdGet32 (PcdFvSize) > Base) &&\r
-          (Base + Size) > PcdGet64 (PcdFvBaseAddress)) {\r
+          ((Base + Size) > PcdGet64 (PcdFvBaseAddress)))\r
+      {\r
         continue;\r
       }\r
 \r
@@ -97,15 +117,20 @@ NorFlashPlatformGetDevices (
     // code, which is not intended to be guest updatable, and is usually backed\r
     // in a readonly manner by QEMU anyway.\r
     //\r
-    Status = FdtClient->SetNodeProperty (FdtClient, Node, "status",\r
-                          "disabled", sizeof ("disabled"));\r
+    Status = FdtClient->SetNodeProperty (\r
+                          FdtClient,\r
+                          Node,\r
+                          "status",\r
+                          "disabled",\r
+                          sizeof ("disabled")\r
+                          );\r
     if (EFI_ERROR (Status)) {\r
       DEBUG ((DEBUG_WARN, "Failed to set NOR flash status to 'disabled'\n"));\r
     }\r
   }\r
 \r
   *NorFlashDescriptions = mNorFlashDevices;\r
-  *Count = Num;\r
+  *Count                = Num;\r
 \r
   return EFI_SUCCESS;\r
 }\r