CorebootModulePkg/CbParseLib: Remove tab and spaces
authorGuo Dong <guo.dong@intel.com>
Wed, 20 May 2015 08:26:19 +0000 (08:26 +0000)
committergdong1 <gdong1@Edk2>
Wed, 20 May 2015 08:26:19 +0000 (08:26 +0000)
Replace tab with space. Remove the sapce at the end of lines.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17485 6f19259b-4bc3-4df7-8a09-765794883524

CorebootModulePkg/Library/CbParseLib/CbParseLib.c

index 56c8472..77a744d 100644 (file)
@@ -37,27 +37,27 @@ CbCheckSum16 (
   IN UINTN    Length\r
   )\r
 {\r
-       UINT32 Sum, TmpValue;\r
-       UINTN  Idx;\r
-       UINT8  *TmpPtr;\r
-       \r
-       Sum = 0;\r
-       TmpPtr = (UINT8 *)Buffer;\r
-       for(Idx = 0; Idx < Length; Idx++) {\r
-               TmpValue  = TmpPtr[Idx];\r
-               if (Idx % 2 == 1) {\r
-                       TmpValue <<= 8;\r
-               }\r
-               \r
-               Sum += TmpValue;\r
-               \r
-               // Wrap\r
-               if (Sum >= 0x10000) {\r
-                       Sum = (Sum + (Sum >> 16)) & 0xFFFF;\r
-               }\r
-       }\r
-       \r
-       return (UINT16)((~Sum) & 0xFFFF);               \r
+  UINT32 Sum, TmpValue;\r
+  UINTN  Idx;\r
+  UINT8  *TmpPtr;\r
+\r
+  Sum = 0;\r
+  TmpPtr = (UINT8 *)Buffer;\r
+  for(Idx = 0; Idx < Length; Idx++) {\r
+    TmpValue  = TmpPtr[Idx];\r
+    if (Idx % 2 == 1) {\r
+      TmpValue <<= 8;\r
+    }\r
+\r
+    Sum += TmpValue;\r
+\r
+    // Wrap\r
+    if (Sum >= 0x10000) {\r
+      Sum = (Sum + (Sum >> 16)) & 0xFFFF;\r
+    }\r
+  }\r
+\r
+  return (UINT16)((~Sum) & 0xFFFF);\r
 }\r
 \r
 VOID *\r
@@ -68,11 +68,11 @@ FindCbTag (
 {\r
   struct cb_header   *Header;\r
   struct cb_record   *Record;\r
-  UINT8              *TmpPtr;  \r
-  UINT8              *TagPtr;  \r
-  UINTN              Idx;  \r
+  UINT8              *TmpPtr;\r
+  UINT8              *TagPtr;\r
+  UINTN              Idx;\r
   UINT16             CheckSum;\r
-      \r
+\r
   Header = NULL;\r
   TmpPtr = (UINT8 *)Start;\r
   for (Idx = 0; Idx < 4096; Idx += 16, TmpPtr += 16) {\r
@@ -81,65 +81,64 @@ FindCbTag (
       break;\r
     }\r
   }\r
-  \r
+\r
   if (Idx >= 4096)\r
-       return NULL;\r
-  \r
+    return NULL;\r
+\r
   if (Header == NULL || !Header->table_bytes)\r
     return NULL;\r
-    \r
+\r
   //\r
   // Check the checksum of the coreboot table header\r
   //\r
   CheckSum = CbCheckSum16 ((UINT16 *)Header, sizeof (*Header));\r
   if (CheckSum != 0) {\r
-       DEBUG ((EFI_D_ERROR, "Invalid coreboot table header checksum\n"));\r
-       return NULL;\r
-  }  \r
-  \r
+    DEBUG ((EFI_D_ERROR, "Invalid coreboot table header checksum\n"));\r
+    return NULL;\r
+  }\r
+\r
   CheckSum = CbCheckSum16 ((UINT16 *)(TmpPtr + sizeof (*Header)), Header->table_bytes);\r
   if (CheckSum != Header->table_checksum) {\r
-       DEBUG ((EFI_D_ERROR, "Incorrect checksum of all the coreboot table entries\n"));\r
-       return NULL;\r
+    DEBUG ((EFI_D_ERROR, "Incorrect checksum of all the coreboot table entries\n"));\r
+    return NULL;\r
   }\r
-     \r
+\r
   TagPtr = NULL;\r
   TmpPtr += Header->header_bytes;\r
   for (Idx = 0; Idx < Header->table_entries; Idx++) {\r
-    Record = (struct cb_record *)TmpPtr;        \r
+    Record = (struct cb_record *)TmpPtr;\r
     if (Record->tag == CB_TAG_FORWARD) {\r
       TmpPtr = (VOID *)(UINTN)((struct cb_forward *)(UINTN)Record)->forward;\r
       if (Tag == CB_TAG_FORWARD)\r
         return TmpPtr;\r
-      else \r
+      else\r
         return FindCbTag (TmpPtr, Tag);\r
-    }       \r
+    }\r
     if (Record->tag == Tag) {\r
       TagPtr = TmpPtr;\r
       break;\r
     }\r
-    TmpPtr += Record->size;    \r
+    TmpPtr += Record->size;\r
   }\r
-    \r
+\r
   return TagPtr;\r
 }\r
 \r
 RETURN_STATUS\r
-FindCbMemTable (  \r
+FindCbMemTable (\r
   IN  struct cbmem_root  *Root,\r
   IN  UINT32             TableId,\r
   OUT VOID               **pMemTable,\r
   OUT UINT32             *pMemTableSize\r
-)\r
-{      \r
+  )\r
+{\r
   UINTN                Idx;\r
   BOOLEAN              IsImdEntry;\r
   struct cbmem_entry  *Entries;\r
-       \r
+\r
   if ((Root == NULL) || (pMemTable == NULL)) {\r
     return RETURN_INVALID_PARAMETER;\r
   }\r
-               \r
   //\r
   // Check if the entry is CBMEM or IMD\r
   // and handle them separately\r
@@ -166,13 +165,13 @@ FindCbMemTable (
       if (pMemTableSize != NULL) {\r
         *pMemTableSize = Entries[Idx].size;\r
       }\r
-       \r
+\r
       DEBUG ((EFI_D_INFO, "Find CbMemTable Id 0x%x, base %p, size 0x%x\n", TableId, *pMemTable, *pMemTableSize));\r
-       return RETURN_SUCCESS;\r
+      return RETURN_SUCCESS;\r
     }\r
   }\r
-  \r
-  return RETURN_NOT_FOUND;     \r
+\r
+  return RETURN_NOT_FOUND;\r
 }\r
 \r
 \r
@@ -193,49 +192,49 @@ CbParseMemoryInfo (
   IN UINT64*    pHighMemorySize\r
   )\r
 {\r
-       struct cb_memory*        rec;\r
-       struct cb_memory_range*  Range;\r
+  struct cb_memory*        rec;\r
+  struct cb_memory_range*  Range;\r
   UINT64                   Start;\r
   UINT64                   Size;\r
-       UINTN                    Index;\r
-       \r
-       if ((!pLowMemorySize) || (!pHighMemorySize))\r
-               return RETURN_INVALID_PARAMETER;\r
-       \r
-       //\r
-       // Get the coreboot memory table\r
-       //\r
-       rec = (struct cb_memory *)FindCbTag (0, CB_TAG_MEMORY);\r
-       if (!rec) \r
-         rec = (struct cb_memory *)FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), CB_TAG_MEMORY);\r
-               \r
-       if (!rec) \r
-               return RETURN_NOT_FOUND;\r
-               \r
-       *pLowMemorySize = 0;\r
-       *pHighMemorySize = 0;\r
-               \r
-       for (Index = 0; Index < MEM_RANGE_COUNT(rec); Index++) {\r
-    Range = MEM_RANGE_PTR(rec, Index);    \r
+  UINTN                    Index;\r
+\r
+  if ((!pLowMemorySize) || (!pHighMemorySize))\r
+    return RETURN_INVALID_PARAMETER;\r
+\r
+  //\r
+  // Get the coreboot memory table\r
+  //\r
+  rec = (struct cb_memory *)FindCbTag (0, CB_TAG_MEMORY);\r
+  if (!rec)\r
+    rec = (struct cb_memory *)FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), CB_TAG_MEMORY);\r
+\r
+  if (!rec)\r
+    return RETURN_NOT_FOUND;\r
+\r
+  *pLowMemorySize = 0;\r
+  *pHighMemorySize = 0;\r
+\r
+  for (Index = 0; Index < MEM_RANGE_COUNT(rec); Index++) {\r
+    Range = MEM_RANGE_PTR(rec, Index);\r
     Start = cb_unpack64(Range->start);\r
     Size = cb_unpack64(Range->size);\r
     DEBUG ((EFI_D_ERROR, "%d. %016lx - %016lx [%02x]\n",\r
-      Index, Start, Start + Size - 1, Range->type));\r
-    \r
+            Index, Start, Start + Size - 1, Range->type));\r
+\r
     if (Range->type != CB_MEM_RAM) {\r
       continue;\r
     }\r
-      \r
+\r
     if (Start + Size < 0x100000000ULL) {\r
       *pLowMemorySize = Start + Size;\r
-    } else {      \r
+    } else {\r
       *pHighMemorySize = Start + Size - 0x100000000ULL;\r
     }\r
   }\r
-  \r
+\r
   DEBUG ((EFI_D_ERROR, "Low memory 0x%lx, High Memory 0x%lx\n", *pLowMemorySize, *pHighMemorySize));\r
-  \r
-  return RETURN_SUCCESS;       \r
+\r
+  return RETURN_SUCCESS;\r
 }\r
 \r
 \r
@@ -253,44 +252,44 @@ CbParseMemoryInfo (
 **/\r
 RETURN_STATUS\r
 CbParseCbMemTable (\r
-  IN UINT32     TableId, \r
+  IN UINT32     TableId,\r
   IN VOID**     pMemTable,\r
   IN UINT32*    pMemTableSize\r
   )\r
 {\r
-       struct cb_memory*        rec;\r
-       struct cb_memory_range*  Range;\r
+  struct cb_memory*        rec;\r
+  struct cb_memory_range*  Range;\r
   UINT64                   Start;\r
   UINT64                   Size;\r
-       UINTN                    Index;\r
-       \r
-       if (!pMemTable)\r
-               return RETURN_INVALID_PARAMETER;\r
-               \r
-       *pMemTable = NULL;\r
-       \r
-       //\r
-       // Get the coreboot memory table\r
-       //\r
-       rec = (struct cb_memory *)FindCbTag (0, CB_TAG_MEMORY);\r
-       if (!rec)\r
-               rec = (struct cb_memory *)FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), CB_TAG_MEMORY);\r
-               \r
-       if (!rec)\r
-               return RETURN_NOT_FOUND;\r
-               \r
-       for (Index = 0; Index < MEM_RANGE_COUNT(rec); Index++) {\r
-    Range = MEM_RANGE_PTR(rec, Index);    \r
+  UINTN                    Index;\r
+\r
+  if (!pMemTable)\r
+    return RETURN_INVALID_PARAMETER;\r
+\r
+  *pMemTable = NULL;\r
+\r
+  //\r
+  // Get the coreboot memory table\r
+  //\r
+  rec = (struct cb_memory *)FindCbTag (0, CB_TAG_MEMORY);\r
+  if (!rec)\r
+    rec = (struct cb_memory *)FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), CB_TAG_MEMORY);\r
+\r
+  if (!rec)\r
+    return RETURN_NOT_FOUND;\r
+\r
+  for (Index = 0; Index < MEM_RANGE_COUNT(rec); Index++) {\r
+    Range = MEM_RANGE_PTR(rec, Index);\r
     Start = cb_unpack64(Range->start);\r
     Size = cb_unpack64(Range->size);\r
-    \r
+\r
     if ((Range->type == CB_MEM_TABLE) && (Start > 0x1000)) {\r
-        if (FindCbMemTable ((struct  cbmem_root *)(UINTN)(Start + Size - DYN_CBMEM_ALIGN_SIZE), TableId, pMemTable, pMemTableSize) == RETURN_SUCCESS)\r
-               return RETURN_SUCCESS;\r
+      if (FindCbMemTable ((struct  cbmem_root *)(UINTN)(Start + Size - DYN_CBMEM_ALIGN_SIZE), TableId, pMemTable, pMemTableSize) == RETURN_SUCCESS)\r
+        return RETURN_SUCCESS;\r
     }\r
   }\r
-       \r
-       return RETURN_NOT_FOUND;\r
+\r
+  return RETURN_NOT_FOUND;\r
 }\r
 \r
 \r
@@ -311,7 +310,7 @@ CbParseAcpiTable (
   IN UINT32*    pMemTableSize\r
   )\r
 {\r
-       return CbParseCbMemTable (SIGNATURE_32 ('I', 'P', 'C', 'A'), (VOID **)pMemTable, pMemTableSize);        \r
+  return CbParseCbMemTable (SIGNATURE_32 ('I', 'P', 'C', 'A'), (VOID **)pMemTable, pMemTableSize);\r
 }\r
 \r
 /**\r
@@ -331,7 +330,7 @@ CbParseSmbiosTable (
   IN UINT32*    pMemTableSize\r
   )\r
 {\r
-       return CbParseCbMemTable (SIGNATURE_32 ('T', 'B', 'M', 'S'), pMemTable, pMemTableSize); \r
+  return CbParseCbMemTable (SIGNATURE_32 ('T', 'B', 'M', 'S'), pMemTable, pMemTableSize);\r
 }\r
 \r
 /**\r
@@ -354,93 +353,93 @@ CbParseFadtInfo (
   IN UINTN*     pResetValue\r
   )\r
 {\r
-       EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER* Rsdp;\r
-       EFI_ACPI_DESCRIPTION_HEADER*                  Rsdt;\r
+  EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER* Rsdp;\r
+  EFI_ACPI_DESCRIPTION_HEADER*                  Rsdt;\r
   UINT32*                                       Entry32;\r
   UINTN                                         Entry32Num;\r
   EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE*    Fadt;\r
-  EFI_ACPI_DESCRIPTION_HEADER*                  Xsdt; \r
+  EFI_ACPI_DESCRIPTION_HEADER*                  Xsdt;\r
   UINT64*                                       Entry64;\r
   UINTN                                         Entry64Num;\r
-       UINTN                                         Idx;\r
-       RETURN_STATUS                                 Status;\r
-       \r
-       Rsdp = NULL;\r
-       Status = RETURN_SUCCESS;\r
-       \r
-       Status = CbParseAcpiTable (&Rsdp, NULL);\r
-       if (RETURN_ERROR(Status))\r
-               return Status;\r
-               \r
-       if (!Rsdp)\r
-               return RETURN_NOT_FOUND;\r
-               \r
-       DEBUG ((EFI_D_ERROR, "Find Rsdp at %p\n", Rsdp));\r
-       DEBUG ((EFI_D_ERROR, "Find Rsdt 0x%x, Xsdt 0x%lx\n", Rsdp->RsdtAddress, Rsdp->XsdtAddress));\r
-       \r
-       //\r
-       // Search Rsdt First\r
-       //\r
-       Rsdt     = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)(Rsdp->RsdtAddress);  \r
-       if (Rsdt != NULL) {\r
-         Entry32  = (UINT32 *)(Rsdt + 1);\r
-         Entry32Num = (Rsdt->Length - sizeof(EFI_ACPI_DESCRIPTION_HEADER)) >> 2;\r
-         for (Idx = 0; Idx < Entry32Num; Idx++) {\r
-           if (*(UINT32 *)(UINTN)(Entry32[Idx]) == EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) {\r
-             Fadt = (EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)(UINTN)(Entry32[Idx]);  \r
-             if (pPmCtrlReg)\r
-               *pPmCtrlReg = Fadt->Pm1aCntBlk;         \r
-             DEBUG ((EFI_D_ERROR, "PmCtrl Reg 0x%x\n", Fadt->Pm1aCntBlk));\r
-               \r
-             if (pPmTimerReg)   \r
-               *pPmTimerReg = Fadt->PmTmrBlk; \r
-             DEBUG ((EFI_D_ERROR, "PmTimer Reg 0x%x\n", Fadt->PmTmrBlk));\r
-               \r
-             if (pResetReg)   \r
-               *pResetReg = (UINTN)Fadt->ResetReg.Address; \r
-             DEBUG ((EFI_D_ERROR, "Reset Reg 0x%lx\n", Fadt->ResetReg.Address));\r
-               \r
-             if (pResetValue)   \r
-               *pResetValue = Fadt->ResetValue;\r
-             DEBUG ((EFI_D_ERROR, "Reset Value 0x%x\n", Fadt->ResetValue));\r
-                                \r
-             return RETURN_SUCCESS;        \r
-           }\r
-         }\r
-       }\r
-       \r
-       //\r
-       // Search Xsdt Second\r
-       //\r
-       Xsdt     = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)(Rsdp->XsdtAddress);  \r
-       if (Xsdt != NULL) {\r
-         Entry64  = (UINT64 *)(Xsdt + 1);\r
-         Entry64Num = (Xsdt->Length - sizeof(EFI_ACPI_DESCRIPTION_HEADER)) >> 3;\r
-         for (Idx = 0; Idx < Entry64Num; Idx++) {\r
-           if (*(UINT32 *)(UINTN)(Entry64[Idx]) == EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) {\r
-             Fadt = (EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)(UINTN)(Entry64[Idx]);  \r
-             if (pPmCtrlReg)\r
-               *pPmCtrlReg = Fadt->Pm1aCntBlk;         \r
-             DEBUG ((EFI_D_ERROR, "PmCtrl Reg 0x%x\n", Fadt->Pm1aCntBlk));\r
-               \r
-             if (pPmTimerReg)   \r
-               *pPmTimerReg = Fadt->PmTmrBlk; \r
-             DEBUG ((EFI_D_ERROR, "PmTimer Reg 0x%x\n", Fadt->PmTmrBlk));\r
-               \r
-             if (pResetReg)   \r
-               *pResetReg = (UINTN)Fadt->ResetReg.Address; \r
-             DEBUG ((EFI_D_ERROR, "Reset Reg 0x%lx\n", Fadt->ResetReg.Address));\r
-               \r
-             if (pResetValue)   \r
-               *pResetValue = Fadt->ResetValue;\r
-             DEBUG ((EFI_D_ERROR, "Reset Value 0x%x\n", Fadt->ResetValue));\r
-                                \r
-             return RETURN_SUCCESS;        \r
-           }\r
-         }\r
-       }       \r
-       \r
-       return RETURN_NOT_FOUND;\r
+  UINTN                                         Idx;\r
+  RETURN_STATUS                                 Status;\r
+\r
+  Rsdp = NULL;\r
+  Status = RETURN_SUCCESS;\r
+\r
+  Status = CbParseAcpiTable (&Rsdp, NULL);\r
+  if (RETURN_ERROR(Status))\r
+    return Status;\r
+\r
+  if (!Rsdp)\r
+    return RETURN_NOT_FOUND;\r
+\r
+  DEBUG ((EFI_D_ERROR, "Find Rsdp at %p\n", Rsdp));\r
+  DEBUG ((EFI_D_ERROR, "Find Rsdt 0x%x, Xsdt 0x%lx\n", Rsdp->RsdtAddress, Rsdp->XsdtAddress));\r
+\r
+  //\r
+  // Search Rsdt First\r
+  //\r
+  Rsdt     = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)(Rsdp->RsdtAddress);\r
+  if (Rsdt != NULL) {\r
+    Entry32  = (UINT32 *)(Rsdt + 1);\r
+    Entry32Num = (Rsdt->Length - sizeof(EFI_ACPI_DESCRIPTION_HEADER)) >> 2;\r
+    for (Idx = 0; Idx < Entry32Num; Idx++) {\r
+      if (*(UINT32 *)(UINTN)(Entry32[Idx]) == EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) {\r
+        Fadt = (EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)(UINTN)(Entry32[Idx]);\r
+        if (pPmCtrlReg)\r
+          *pPmCtrlReg = Fadt->Pm1aCntBlk;\r
+        DEBUG ((EFI_D_ERROR, "PmCtrl Reg 0x%x\n", Fadt->Pm1aCntBlk));\r
+\r
+        if (pPmTimerReg)\r
+          *pPmTimerReg = Fadt->PmTmrBlk;\r
+        DEBUG ((EFI_D_ERROR, "PmTimer Reg 0x%x\n", Fadt->PmTmrBlk));\r
+\r
+        if (pResetReg)\r
+          *pResetReg = (UINTN)Fadt->ResetReg.Address;\r
+        DEBUG ((EFI_D_ERROR, "Reset Reg 0x%lx\n", Fadt->ResetReg.Address));\r
+\r
+        if (pResetValue)\r
+          *pResetValue = Fadt->ResetValue;\r
+        DEBUG ((EFI_D_ERROR, "Reset Value 0x%x\n", Fadt->ResetValue));\r
+\r
+        return RETURN_SUCCESS;\r
+      }\r
+    }\r
+  }\r
+\r
+  //\r
+  // Search Xsdt Second\r
+  //\r
+  Xsdt     = (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)(Rsdp->XsdtAddress);\r
+  if (Xsdt != NULL) {\r
+    Entry64  = (UINT64 *)(Xsdt + 1);\r
+    Entry64Num = (Xsdt->Length - sizeof(EFI_ACPI_DESCRIPTION_HEADER)) >> 3;\r
+    for (Idx = 0; Idx < Entry64Num; Idx++) {\r
+      if (*(UINT32 *)(UINTN)(Entry64[Idx]) == EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) {\r
+        Fadt = (EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)(UINTN)(Entry64[Idx]);\r
+        if (pPmCtrlReg)\r
+          *pPmCtrlReg = Fadt->Pm1aCntBlk;\r
+        DEBUG ((EFI_D_ERROR, "PmCtrl Reg 0x%x\n", Fadt->Pm1aCntBlk));\r
+\r
+        if (pPmTimerReg)\r
+          *pPmTimerReg = Fadt->PmTmrBlk;\r
+        DEBUG ((EFI_D_ERROR, "PmTimer Reg 0x%x\n", Fadt->PmTmrBlk));\r
+\r
+        if (pResetReg)\r
+          *pResetReg = (UINTN)Fadt->ResetReg.Address;\r
+        DEBUG ((EFI_D_ERROR, "Reset Reg 0x%lx\n", Fadt->ResetReg.Address));\r
+\r
+        if (pResetValue)\r
+          *pResetValue = Fadt->ResetValue;\r
+        DEBUG ((EFI_D_ERROR, "Reset Value 0x%x\n", Fadt->ResetValue));\r
+\r
+        return RETURN_SUCCESS;\r
+      }\r
+    }\r
+  }\r
+\r
+  return RETURN_NOT_FOUND;\r
 }\r
 \r
 /**\r
@@ -461,25 +460,25 @@ CbParseSerialInfo (
   IN UINT32*     pBaudrate\r
   )\r
 {\r
-       struct cb_serial*   CbSerial;\r
-       \r
-       CbSerial = FindCbTag (0, CB_TAG_SERIAL);\r
-       if (!CbSerial)\r
-               CbSerial = FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), CB_TAG_SERIAL);\r
-       \r
-       if (!CbSerial)\r
-               return RETURN_NOT_FOUND;\r
-               \r
-       if (pRegBase)\r
-               *pRegBase = CbSerial->baseaddr;\r
-               \r
-       if (pRegAccessType)\r
-               *pRegAccessType = CbSerial->type;\r
-               \r
-       if (pBaudrate)\r
-               *pBaudrate = CbSerial->baud;\r
-                       \r
-       return RETURN_SUCCESS;\r
+  struct cb_serial*   CbSerial;\r
+\r
+  CbSerial = FindCbTag (0, CB_TAG_SERIAL);\r
+  if (!CbSerial)\r
+    CbSerial = FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), CB_TAG_SERIAL);\r
+\r
+  if (!CbSerial)\r
+    return RETURN_NOT_FOUND;\r
+\r
+  if (pRegBase)\r
+    *pRegBase = CbSerial->baseaddr;\r
+\r
+  if (pRegAccessType)\r
+    *pRegAccessType = CbSerial->type;\r
+\r
+  if (pBaudrate)\r
+    *pBaudrate = CbSerial->baud;\r
+\r
+  return RETURN_SUCCESS;\r
 }\r
 \r
 /**\r
@@ -498,25 +497,25 @@ CbParseGetCbHeader (
   IN VOID** HeaderPtr\r
   )\r
 {\r
-       UINTN Index;\r
-       VOID* TempPtr;\r
-       \r
-       if (!HeaderPtr)\r
-               return RETURN_NOT_FOUND;\r
-       \r
-       TempPtr = NULL; \r
-       for (Index = 0; Index < Level; Index++) {\r
-               TempPtr = FindCbTag (TempPtr, CB_TAG_FORWARD);\r
-               if (!TempPtr)\r
-                       break;          \r
-       }\r
-       \r
-       if ((Index >= Level) && (TempPtr != NULL)) {\r
-               *HeaderPtr = TempPtr;\r
-               return RETURN_SUCCESS;\r
-       }\r
-       \r
-       return RETURN_NOT_FOUND;\r
+  UINTN Index;\r
+  VOID* TempPtr;\r
+\r
+  if (!HeaderPtr)\r
+    return RETURN_NOT_FOUND;\r
+\r
+  TempPtr = NULL;\r
+  for (Index = 0; Index < Level; Index++) {\r
+    TempPtr = FindCbTag (TempPtr, CB_TAG_FORWARD);\r
+    if (!TempPtr)\r
+      break;\r
+  }\r
+\r
+  if ((Index >= Level) && (TempPtr != NULL)) {\r
+    *HeaderPtr = TempPtr;\r
+    return RETURN_SUCCESS;\r
+  }\r
+\r
+  return RETURN_NOT_FOUND;\r
 }\r
 \r
 /**\r
@@ -533,25 +532,25 @@ CbParseFbInfo (
   IN FRAME_BUFFER_INFO*     pFbInfo\r
   )\r
 {\r
-       struct cb_framebuffer*   CbFbRec;\r
-       \r
-       if (!pFbInfo)\r
-               return RETURN_INVALID_PARAMETER;\r
-       \r
-       CbFbRec = FindCbTag (0, CB_TAG_FRAMEBUFFER);\r
-       if (!CbFbRec)\r
-               CbFbRec = FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), CB_TAG_FRAMEBUFFER);\r
-       \r
-       if (!CbFbRec)\r
-               return RETURN_NOT_FOUND;\r
-               \r
+  struct cb_framebuffer*   CbFbRec;\r
+\r
+  if (!pFbInfo)\r
+    return RETURN_INVALID_PARAMETER;\r
+\r
+  CbFbRec = FindCbTag (0, CB_TAG_FRAMEBUFFER);\r
+  if (!CbFbRec)\r
+    CbFbRec = FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), CB_TAG_FRAMEBUFFER);\r
+\r
+  if (!CbFbRec)\r
+    return RETURN_NOT_FOUND;\r
+\r
   DEBUG ((EFI_D_ERROR, "Found coreboot video frame buffer information\n"));\r
   DEBUG ((EFI_D_ERROR, "physical_address: 0x%lx\n", CbFbRec->physical_address));\r
   DEBUG ((EFI_D_ERROR, "x_resolution: 0x%x\n", CbFbRec->x_resolution));\r
   DEBUG ((EFI_D_ERROR, "y_resolution: 0x%x\n", CbFbRec->y_resolution));\r
   DEBUG ((EFI_D_ERROR, "bits_per_pixel: 0x%x\n", CbFbRec->bits_per_pixel));\r
   DEBUG ((EFI_D_ERROR, "bytes_per_line: 0x%x\n", CbFbRec->bytes_per_line));\r
-  \r
+\r
   DEBUG ((EFI_D_ERROR, "red_mask_size: 0x%x\n", CbFbRec->red_mask_size));\r
   DEBUG ((EFI_D_ERROR, "red_mask_pos: 0x%x\n", CbFbRec->red_mask_pos));\r
   DEBUG ((EFI_D_ERROR, "green_mask_size: 0x%x\n", CbFbRec->green_mask_size));\r
@@ -560,8 +559,8 @@ CbParseFbInfo (
   DEBUG ((EFI_D_ERROR, "blue_mask_pos: 0x%x\n", CbFbRec->blue_mask_pos));\r
   DEBUG ((EFI_D_ERROR, "reserved_mask_size: 0x%x\n", CbFbRec->reserved_mask_size));\r
   DEBUG ((EFI_D_ERROR, "reserved_mask_pos: 0x%x\n", CbFbRec->reserved_mask_pos));\r
-       \r
-  pFbInfo->LinearFrameBuffer    = CbFbRec->physical_address;  \r
+\r
+  pFbInfo->LinearFrameBuffer    = CbFbRec->physical_address;\r
   pFbInfo->HorizontalResolution = CbFbRec->x_resolution;\r
   pFbInfo->VerticalResolution   = CbFbRec->y_resolution;\r
   pFbInfo->BitsPerPixel         = CbFbRec->bits_per_pixel;\r
@@ -573,9 +572,8 @@ CbParseFbInfo (
   pFbInfo->Blue.Mask            = (1 << CbFbRec->blue_mask_size) - 1;\r
   pFbInfo->Blue.Position        = CbFbRec->blue_mask_pos;\r
   pFbInfo->Reserved.Mask        = (1 << CbFbRec->reserved_mask_size) - 1;\r
-  pFbInfo->Reserved.Position    = CbFbRec->reserved_mask_pos;  \r
-                       \r
-       return RETURN_SUCCESS;\r
-}\r
+  pFbInfo->Reserved.Position    = CbFbRec->reserved_mask_pos;\r
 \r
+  return RETURN_SUCCESS;\r
+}\r
 \r