]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/iScsi/IScsiMisc.c
UEFI HII: Merge UEFI HII support changes from branch.
[mirror_edk2.git] / MdeModulePkg / Universal / iScsi / IScsiMisc.c
index 214af746976333e571b40b8cda2853b101a5d46d..0347d320423275a0145531c9ec860ace3c9d508c 100644 (file)
@@ -167,7 +167,7 @@ Returns:
     Len++;\r
   }\r
 \r
-  return (UINT8)(32 - Len);\r
+  return 32 - Len;\r
 }\r
 \r
 EFI_STATUS\r
@@ -196,7 +196,6 @@ Returns:
   UINT32  Index;\r
   CHAR8   *LunUnitStr[4];\r
   CHAR8   Digit;\r
-  UINTN   Temp;\r
 \r
   NetZeroMem (Lun, 8);\r
   NetZeroMem (LunUnitStr, sizeof (LunUnitStr));\r
@@ -204,7 +203,7 @@ Returns:
   Index         = 0;\r
   LunUnitStr[0] = Str;\r
 \r
-  if (!IsHexDigit ((UINT8 *)&Digit, *Str)) {\r
+  if (!IsHexDigit (&Digit, *Str)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -220,13 +219,13 @@ Returns:
       Index++;\r
 \r
       if (*(Str + 1) != '\0') {\r
-        if (!IsHexDigit ((UINT8 *)&Digit, *(Str + 1))) {\r
+        if (!IsHexDigit (&Digit, *(Str + 1))) {\r
           return EFI_INVALID_PARAMETER;\r
         }\r
 \r
         LunUnitStr[Index] = Str + 1;\r
       }\r
-    } else if (!IsHexDigit ((UINT8 *)&Digit, *Str)) {\r
+    } else if (!IsHexDigit (&Digit, *Str)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
@@ -238,8 +237,7 @@ Returns:
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
-    Temp = AsciiStrHexToUintn (LunUnitStr[Index]);\r
-    *((UINT16 *) &Lun[Index * 2]) = HTONS (Temp);\r
+    *((UINT16 *) &Lun[Index * 2]) = HTONS (AsciiStrHexToUintn (LunUnitStr[Index]));\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -472,7 +470,7 @@ Returns:
   UINT32  Index;\r
 \r
   for (Index = 0; Index < Len; Index++) {\r
-    Str[3 * Index]      = NibbleToHexChar ((UINT8)(Mac->Addr[Index] >> 4));\r
+    Str[3 * Index]      = NibbleToHexChar (Mac->Addr[Index] >> 4);\r
     Str[3 * Index + 1]  = NibbleToHexChar (Mac->Addr[Index]);\r
     Str[3 * Index + 2]  = L'-';\r
   }\r
@@ -602,7 +600,7 @@ Returns:
     } else {\r
       Byte = BinBuffer[*BinLength - 1 - Index / 2];\r
       Byte &= 0x0F;\r
-      Byte = (UINT8)(Byte | (Digit << 4));\r
+      Byte |= Digit << 4;\r
     }\r
 \r
     BinBuffer[*BinLength - 1 - Index / 2] = Byte;\r
@@ -811,7 +809,7 @@ Returns:
   Status = gBS->HandleProtocol (\r
                   Private->Controller,\r
                   &gEfiSimpleNetworkProtocolGuid,\r
-                  (void **)&Snp\r
+                  &Snp\r
                   );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -907,7 +905,7 @@ Returns:
   Status = gBS->HandleProtocol (\r
                   Tcp4Io->Handle,\r
                   &gEfiDevicePathProtocolGuid,\r
-                  (void **)&DevicePath\r
+                  &DevicePath\r
                   );\r
   if (EFI_ERROR (Status)) {\r
     return NULL;\r
@@ -925,7 +923,7 @@ Returns:
         ) {\r
 \r
       DPathNode->Ipv4.LocalPort       = 0;\r
-      DPathNode->Ipv4.StaticIpAddress = (BOOLEAN)(!Session->ConfigData.NvData.InitiatorInfoFromDhcp);\r
+      DPathNode->Ipv4.StaticIpAddress = !Session->ConfigData.NvData.InitiatorInfoFromDhcp;\r
       break;\r
     }\r
 \r