]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
ShellPkg: Clean up source files
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / SmbiosView.c
index 6e7c7637a19a4de1dce8354a134ec3990a8b1a2b..e20b20793df61f1e80d6036976cad240a3370b0f 100644 (file)
@@ -2,7 +2,7 @@
   Tools of clarify the content of the smbios table.\r
 \r
   (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -69,7 +69,7 @@ ShellCommandRunSmbiosView (
   Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);\r
   if (EFI_ERROR(Status)) {\r
     if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"smbiosview", ProblemParam);  \r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"smbiosview", ProblemParam);\r
       FreePool(ProblemParam);\r
       ShellStatus = SHELL_INVALID_PARAMETER;\r
     } else {\r
@@ -77,13 +77,13 @@ ShellCommandRunSmbiosView (
     }\r
   } else {\r
     if (ShellCommandLineGetCount(Package) > 1) {\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");  \r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");\r
       ShellStatus = SHELL_INVALID_PARAMETER;\r
     } else if (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetValue(Package, L"-t") == NULL) {\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-t");  \r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-t");\r
       ShellStatus = SHELL_INVALID_PARAMETER;\r
     } else if (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetValue(Package, L"-h") == NULL) {\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle,  L"smbiosview", L"-h");  \r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle,  L"smbiosview", L"-h");\r
       ShellStatus = SHELL_INVALID_PARAMETER;\r
     } else if (\r
         (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-h")) ||\r
@@ -93,7 +93,7 @@ ShellCommandRunSmbiosView (
         (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-a")) ||\r
         (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-a"))\r
       ) {\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");  \r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");\r
       ShellStatus = SHELL_INVALID_PARAMETER;\r
     } else {\r
 \r
@@ -103,30 +103,30 @@ ShellCommandRunSmbiosView (
       Status1 = LibSmbiosInit ();\r
       Status2 = LibSmbios64BitInit ();\r
       if (EFI_ERROR (Status1) && EFI_ERROR (Status2)) {\r
-       ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), gShellDebug1HiiHandle);\r
+        ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), gShellDebug1HiiHandle);\r
         ShellStatus = SHELL_NOT_FOUND;\r
         goto Done;\r
       }\r
-      \r
+\r
       StructType    = STRUCTURE_TYPE_RANDOM;\r
       RandomView    = TRUE;\r
-      \r
+\r
       Temp          = ShellCommandLineGetValue(Package, L"-t");\r
       if (Temp != NULL) {\r
         StructType = (UINT8) ShellStrToUintn (Temp);\r
       }\r
-      \r
+\r
       if (ShellCommandLineGetFlag(Package, L"-a")) {\r
         gShowType = SHOW_ALL;\r
       }\r
-      \r
+\r
       if (!EFI_ERROR (Status1)) {\r
         //\r
         // Initialize the StructHandle to be the first handle\r
         //\r
         StructHandle  = INVALID_HANDLE;\r
         LibGetSmbiosStructure (&StructHandle, NULL, NULL);\r
-        \r
+\r
         Temp = ShellCommandLineGetValue(Package, L"-h");\r
         if (Temp != NULL) {\r
           RandomView   = FALSE;\r
@@ -140,7 +140,7 @@ ShellCommandRunSmbiosView (
           ShellStatus = SHELL_NOT_FOUND;\r
           goto Done;\r
         }\r
-        \r
+\r
         if (ShellCommandLineGetFlag(Package, L"-s")) {\r
           Status = DisplayStatisticsTable (SHOW_DETAIL);\r
           if (EFI_ERROR(Status)) {\r
@@ -148,7 +148,7 @@ ShellCommandRunSmbiosView (
           }\r
           goto Show64Bit;\r
         }\r
-        \r
+\r
         //\r
         // Show SMBIOS structure information\r
         //\r
@@ -174,13 +174,13 @@ Show64Bit:
         //\r
         StructHandle  = INVALID_HANDLE;\r
         LibGetSmbios64BitStructure (&StructHandle, NULL, NULL);\r
-        \r
+\r
         Temp = ShellCommandLineGetValue(Package, L"-h");\r
         if (Temp != NULL) {\r
           RandomView   = FALSE;\r
           StructHandle = (UINT16) ShellStrToUintn(Temp);\r
         }\r
-        \r
+\r
         if (ShellCommandLineGetFlag(Package, L"-s")) {\r
           Status = DisplaySmbios64BitStatisticsTable (SHOW_DETAIL);\r
           if (EFI_ERROR(Status)) {\r
@@ -188,7 +188,7 @@ Show64Bit:
           }\r
           goto Done;\r
         }\r
-        \r
+\r
         //\r
         // Show SMBIOS structure information\r
         //\r
@@ -666,7 +666,7 @@ InitSmbiosTableStatistics (
   @param[out] NumberOfSmbios64Structures  The number of structures in 64-bit SMBIOS table.\r
   @param[out] Smbios64TableLength         The total length of 64-bit SMBIOS table.\r
 \r
-  @retval EFI_SUCCESS                                                  Calculation was successful.\r
+  @retval EFI_SUCCESS                     Calculation was successful.\r
 **/\r
 EFI_STATUS\r
 CalculateSmbios64BitStructureCountAndLength (\r
@@ -677,10 +677,10 @@ CalculateSmbios64BitStructureCountAndLength (
 {\r
   SMBIOS_STRUCTURE_POINTER        Smbios;\r
   UINT8                           *Raw;\r
-  \r
+\r
   *Smbios64TableLength = 0;\r
   *NumberOfSmbios64Structures = 0;\r
-  \r
+\r
   Smbios.Raw = (UINT8 *)(UINTN)(Smbios64EntryPoint->TableAddress);\r
   while (TRUE) {\r
     if (Smbios.Hdr->Type == 127) {\r
@@ -702,11 +702,11 @@ CalculateSmbios64BitStructureCountAndLength (
     //\r
     (*Smbios64TableLength) += ((UINTN) Smbios.Raw - (UINTN) Raw);\r
     if ((*Smbios64TableLength) > Smbios64EntryPoint->TableMaximumSize) {\r
-       //\r
-       // The actual table length exceeds maximum table size,\r
-       // There should be something wrong with SMBIOS table.\r
-       //\r
-       return EFI_INVALID_PARAMETER;\r
+      //\r
+      // The actual table length exceeds maximum table size,\r
+      // There should be something wrong with SMBIOS table.\r
+      //\r
+      return EFI_INVALID_PARAMETER;\r
     }\r
     (*NumberOfSmbios64Structures)++;\r
   }\r
@@ -727,7 +727,7 @@ InitSmbios64BitTableStatistics (
   UINT16                    Length;\r
   UINT16                    Offset;\r
   UINT16                    Index;\r
-       EFI_STATUS                                                              Status;\r
+  EFI_STATUS                Status;\r
   SMBIOS_STRUCTURE_POINTER      SmbiosStruct;\r
   SMBIOS_TABLE_3_0_ENTRY_POINT  *SMBiosTable;\r
   STRUCTURE_STATISTICS          *StatisticsPointer;\r
@@ -755,9 +755,9 @@ InitSmbios64BitTableStatistics (
   //\r
   Status = CalculateSmbios64BitStructureCountAndLength (SMBiosTable, &mNumberOfSmbios64BitStructures, &mSmbios64BitTableLength);\r
   if ((EFI_ERROR (Status)) || (mSmbios64BitTableLength > SMBiosTable->TableMaximumSize)) {\r
-       return EFI_INVALID_PARAMETER;\r
+    return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   mSmbios64BitStatisticsTable = (STRUCTURE_STATISTICS *) AllocateZeroPool (mNumberOfSmbios64BitStructures * sizeof (STRUCTURE_STATISTICS));\r
 \r
   if (mSmbios64BitStatisticsTable == NULL) {\r