ShellPkg/acpi: Code cleanup to pass static code checker
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 3 Aug 2018 02:46:34 +0000 (10:46 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 6 Aug 2018 02:12:14 +0000 (10:12 +0800)
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <Hao.a.wu@intel.com>
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c

index 18c4983..5cab200 100644 (file)
@@ -297,7 +297,7 @@ DumpUint64 (
   Val = *(UINT32*)(Ptr + sizeof (UINT32));\r
 \r
   Val <<= 32;\r
-  Val |= *(UINT32*)Ptr;\r
+  Val |= (UINT64)*(UINT32*)Ptr;\r
 \r
   Print (Format, Val);\r
 }\r
index 47ce93f..4199e82 100644 (file)
@@ -284,6 +284,7 @@ ConvertStrToAcpiSignature (
   UINT8 Index;\r
   CHAR8 Ptr[4];\r
 \r
+  ZeroMem (Ptr, sizeof (Ptr));\r
   Index = 0;\r
 \r
   // Convert to Upper case and convert to ASCII\r
index 245700a..c6eb708 100644 (file)
@@ -118,7 +118,7 @@ UefiShellAcpiViewCommandLibConstructor (
   gShellAcpiViewHiiHandle = NULL;\r
 \r
   // Check Shell Profile Debug1 bit of the profiles mask\r
-  if ((FixedPcdGet8 (PcdShellProfileMask) & BIT1) == 0) {\r
+  if ((PcdGet8 (PcdShellProfileMask) & BIT1) == 0) {\r
     return EFI_SUCCESS;\r
   }\r
 \r