]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiMisc.c
index 19577ff1824228b1cda773e55fa68b882687c71c..d924a8b82427ef372ad3325cbcf3e0e29ce43518 100644 (file)
@@ -19,8 +19,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8  IScsiHexString[] = "0123456789ABCDEFa
 /**\r
   Removes (trims) specified leading and trailing characters from a string.\r
 \r
-  @param[in, out]  Str  Pointer to the null-terminated string to be trimmed. On return, \r
-                        Str will hold the trimmed string. \r
+  @param[in, out]  Str  Pointer to the null-terminated string to be trimmed. On return,\r
+                        Str will hold the trimmed string.\r
 \r
   @param[in]      CharC Character will be trimmed from str.\r
 **/\r
@@ -32,18 +32,18 @@ StrTrim (
 {\r
   CHAR16  *Pointer1;\r
   CHAR16  *Pointer2;\r
-  \r
+\r
   if (*Str == 0) {\r
     return;\r
   }\r
-  \r
+\r
   //\r
   // Trim off the leading and trailing characters c\r
   //\r
   for (Pointer1 = Str; (*Pointer1 != 0) && (*Pointer1 == CharC); Pointer1++) {\r
     ;\r
   }\r
-  \r
+\r
   Pointer2 = Str;\r
   if (Pointer2 == Pointer1) {\r
     while (*Pointer1 != 0) {\r
@@ -51,19 +51,19 @@ StrTrim (
       Pointer1++;\r
     }\r
   } else {\r
-    while (*Pointer1 != 0) {    \r
-    *Pointer2 = *Pointer1;    \r
+    while (*Pointer1 != 0) {\r
+    *Pointer2 = *Pointer1;\r
     Pointer1++;\r
     Pointer2++;\r
     }\r
     *Pointer2 = 0;\r
   }\r
-  \r
-  \r
+\r
+\r
   for (Pointer1 = Str + StrLen(Str) - 1; Pointer1 >= Str && *Pointer1 == CharC; Pointer1--) {\r
     ;\r
   }\r
-  if  (Pointer1 !=  Str + StrLen(Str) - 1) { \r
+  if  (Pointer1 !=  Str + StrLen(Str) - 1) {\r
     *(Pointer1 + 1) = 0;\r
   }\r
 }\r
@@ -109,7 +109,7 @@ IScsiGetSubnetMaskPrefixLength (
 }\r
 \r
 /**\r
-  Convert the hexadecimal encoded LUN string into the 64-bit LUN. \r
+  Convert the hexadecimal encoded LUN string into the 64-bit LUN.\r
 \r
   @param[in]   Str             The hexadecimal encoded LUN string.\r
   @param[out]  Lun             Storage to return the 64-bit LUN.\r
@@ -127,11 +127,11 @@ IScsiAsciiStrToLun (
   CHAR8   TemStr[2];\r
   UINT8   TemValue;\r
   UINT16  Value[4];\r
-  \r
+\r
   ZeroMem (Lun, 8);\r
   ZeroMem (TemStr, 2);\r
   ZeroMem ((UINT8 *) Value, sizeof (Value));\r
-  SizeStr    = AsciiStrLen (Str);  \r
+  SizeStr    = AsciiStrLen (Str);\r
   IndexValue = 0;\r
   IndexNum   = 0;\r
 \r
@@ -146,7 +146,7 @@ IScsiAsciiStrToLun (
         return EFI_INVALID_PARAMETER;\r
       }\r
     }\r
-    \r
+\r
     if ((TemValue == 0) && (TemStr[0] == '-')) {\r
       //\r
       // Next Lun value\r
@@ -163,24 +163,24 @@ IScsiAsciiStrToLun (
       IndexNum = 0;\r
       continue;\r
     }\r
-    \r
+\r
     if (++IndexNum > 4) {\r
-      //     \r
+      //\r
       // Each Lun Str can't exceed size 4, because it will be as UINT16 value\r
       //\r
       return EFI_INVALID_PARAMETER;\r
     }\r
-    \r
+\r
     //\r
     // Combine UINT16 value\r
     //\r
     Value[IndexValue] = (UINT16) ((Value[IndexValue] << 4) + TemValue);\r
   }\r
\r
+\r
   for (Index = 0; Index <= IndexValue; Index ++) {\r
     *((UINT16 *) &Lun[Index * 2]) =  HTONS (Value[Index]);\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -392,7 +392,7 @@ IScsiMacAddrToStr (
   @param[in, out]  HexStr      Pointer to the string.\r
   @param[in, out]  HexLength   The length of the string.\r
 \r
-  @retval EFI_SUCCESS          The binary data is converted to the hexadecimal string \r
+  @retval EFI_SUCCESS          The binary data is converted to the hexadecimal string\r
                                and the length of the string is updated.\r
   @retval EFI_BUFFER_TOO_SMALL The string is too small.\r
   @retval EFI_INVALID_PARAMETER The IP string is malformatted.\r
@@ -455,7 +455,7 @@ IScsiHexToBin (
   UINTN   Length;\r
   UINT8   Digit;\r
   CHAR8   TemStr[2];\r
-  \r
+\r
   ZeroMem (TemStr, sizeof (TemStr));\r
 \r
   //\r
@@ -464,7 +464,7 @@ IScsiHexToBin (
   if ((HexStr[0] == '0') && ((HexStr[1] == 'x') || (HexStr[1] == 'X'))) {\r
     HexStr += 2;\r
   }\r
-  \r
+\r
   Length = AsciiStrLen (HexStr);\r
 \r
   for (Index = 0; Index < Length; Index ++) {\r
@@ -482,7 +482,7 @@ IScsiHexToBin (
       BinBuffer [Index/2] = (UINT8) ((BinBuffer [Index/2] << 4) + Digit);\r
     }\r
   }\r
-  \r
+\r
   *BinLength = (UINT32) ((Index + 1)/2);\r
 \r
   return EFI_SUCCESS;\r
@@ -601,7 +601,7 @@ IScsiCleanDriverData (
   EFI_STATUS             Status;\r
 \r
   Status = EFI_SUCCESS;\r
-  \r
+\r
   if (Private->DevicePath != NULL) {\r
     Status = gBS->UninstallProtocolInterface (\r
                     Private->ExtScsiPassThruHandle,\r
@@ -627,7 +627,7 @@ EXIT:
   if (Private->ExitBootServiceEvent != NULL) {\r
     gBS->CloseEvent (Private->ExitBootServiceEvent);\r
   }\r
-  \r
+\r
   FreePool (Private);\r
   return Status;\r
 }\r
@@ -636,10 +636,10 @@ EXIT:
   Check wheather the Controller is configured to use DHCP protocol.\r
 \r
   @param[in]  Controller           The handle of the controller.\r
-  \r
+\r
   @retval TRUE                     The handle of the controller need the Dhcp protocol.\r
   @retval FALSE                    The handle of the controller does not need the Dhcp protocol.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 IScsiDhcpIsConfigured (\r
@@ -826,7 +826,7 @@ IScsiGetTcpConnDevicePath (
         ) {\r
 \r
       DPathNode->Ipv4.LocalPort       = 0;\r
-      DPathNode->Ipv4.StaticIpAddress = \r
+      DPathNode->Ipv4.StaticIpAddress =\r
         (BOOLEAN) (!Session->ConfigData.NvData.InitiatorInfoFromDhcp);\r
 \r
       //\r
@@ -835,7 +835,7 @@ IScsiGetTcpConnDevicePath (
       //  do not exist.\r
       //  In new version of IPv4_DEVICE_PATH, structcure length is 27.\r
       //\r
-      if (DevicePathNodeLength (&DPathNode->Ipv4) == IP4_NODE_LEN_NEW_VERSIONS) {  \r
+      if (DevicePathNodeLength (&DPathNode->Ipv4) == IP4_NODE_LEN_NEW_VERSIONS) {\r
 \r
         IP4_COPY_ADDRESS (\r
           &DPathNode->Ipv4.GatewayIpAddress,\r
@@ -873,7 +873,7 @@ IScsiOnExitBootService (
   ISCSI_DRIVER_DATA *Private;\r
 \r
   Private = (ISCSI_DRIVER_DATA *) Context;\r
-  \r
+\r
   gBS->CloseEvent (Private->ExitBootServiceEvent);\r
   Private->ExitBootServiceEvent = NULL;\r
 \r
@@ -887,7 +887,7 @@ IScsiOnExitBootService (
   currently managing the controller specified by ControllerHandle.  This test\r
   is performed by evaluating if the the protocol specified by ProtocolGuid is\r
   present on ControllerHandle and is was opened by DriverBindingHandle and Nic\r
-  Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. \r
+  Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.\r
   If ProtocolGuid is NULL, then ASSERT().\r
 \r
   @param  ControllerHandle     A handle for a controller to test.\r