public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ShellPkg/acpi: Code cleanup to pass static code checker
@ 2018-08-03  3:41 Ruiyu Ni
  2018-08-03  5:08 ` Wu, Hao A
  0 siblings, 1 reply; 2+ messages in thread
From: Ruiyu Ni @ 2018-08-03  3:41 UTC (permalink / raw)
  To: edk2-devel; +Cc: Hao A Wu

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
---
 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c               | 2 +-
 ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c                 | 1 +
 .../Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c   | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index 18c4983e95..5cab20023d 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -297,7 +297,7 @@ DumpUint64 (
   Val = *(UINT32*)(Ptr + sizeof (UINT32));
 
   Val <<= 32;
-  Val |= *(UINT32*)Ptr;
+  Val |= (UINT64)*(UINT32*)Ptr;
 
   Print (Format, Val);
 }
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
index 47ce93f104..4199e82ab1 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
@@ -284,6 +284,7 @@ ConvertStrToAcpiSignature (
   UINT8 Index;
   CHAR8 Ptr[4];
 
+  ZeroMem (Ptr, sizeof (Ptr));
   Index = 0;
 
   // Convert to Upper case and convert to ASCII
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
index 245700a253..c6eb7087cf 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c
@@ -118,7 +118,7 @@ UefiShellAcpiViewCommandLibConstructor (
   gShellAcpiViewHiiHandle = NULL;
 
   // Check Shell Profile Debug1 bit of the profiles mask
-  if ((FixedPcdGet8 (PcdShellProfileMask) & BIT1) == 0) {
+  if ((PcdGet8 (PcdShellProfileMask) & BIT1) == 0) {
     return EFI_SUCCESS;
   }
 
-- 
2.16.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ShellPkg/acpi: Code cleanup to pass static code checker
  2018-08-03  3:41 [PATCH] ShellPkg/acpi: Code cleanup to pass static code checker Ruiyu Ni
@ 2018-08-03  5:08 ` Wu, Hao A
  0 siblings, 0 replies; 2+ messages in thread
From: Wu, Hao A @ 2018-08-03  5:08 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org

Reviewed-by: Hao Wu <Hao.a.wu@intel.com>

Best Regards,
Hao Wu


> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Friday, August 03, 2018 11:42 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A
> Subject: [PATCH] ShellPkg/acpi: Code cleanup to pass static code checker
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> ---
>  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c               | 2 +-
>  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c                 | 1 +
>  .../Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.c   |
> 2 +-
>  3 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> index 18c4983e95..5cab20023d 100644
> --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> @@ -297,7 +297,7 @@ DumpUint64 (
>    Val = *(UINT32*)(Ptr + sizeof (UINT32));
> 
>    Val <<= 32;
> -  Val |= *(UINT32*)Ptr;
> +  Val |= (UINT64)*(UINT32*)Ptr;
> 
>    Print (Format, Val);
>  }
> diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
> index 47ce93f104..4199e82ab1 100644
> --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
> +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c
> @@ -284,6 +284,7 @@ ConvertStrToAcpiSignature (
>    UINT8 Index;
>    CHAR8 Ptr[4];
> 
> +  ZeroMem (Ptr, sizeof (Ptr));
>    Index = 0;
> 
>    // Convert to Upper case and convert to ASCII
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.c
> index 245700a253..c6eb7087cf 100644
> ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.c
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.c
> @@ -118,7 +118,7 @@ UefiShellAcpiViewCommandLibConstructor (
>    gShellAcpiViewHiiHandle = NULL;
> 
>    // Check Shell Profile Debug1 bit of the profiles mask
> -  if ((FixedPcdGet8 (PcdShellProfileMask) & BIT1) == 0) {
> +  if ((PcdGet8 (PcdShellProfileMask) & BIT1) == 0) {
>      return EFI_SUCCESS;
>    }
> 
> --
> 2.16.1.windows.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-03  5:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-03  3:41 [PATCH] ShellPkg/acpi: Code cleanup to pass static code checker Ruiyu Ni
2018-08-03  5:08 ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox