Reviewed-by: Jaben Carsey <jaben.car...@intel.com>

> -----Original Message-----
> From: Qiu, Shumin
> Sent: Sunday, March 27, 2016 11:48 PM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin <shumin....@intel.com>; Carsey, Jaben
> <jaben.car...@intel.com>
> Subject: [PATCH] ShellPkg: Refine the comparisons code in ShellPkg.
> Importance: High
> 
> For Boolean values not use explicit comparisons to TRUE or FALSE. For non-
> Boolean
> comparisons we should use a compare operator.
> 
> Cc: Jaben Carsey <jaben.car...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin <shumin....@intel.com>
> ---
>  .../Library/UefiHandleParsingLib/UefiHandleParsingLib.c    | 14 
> +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> index 48a753d..14e7a9f 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> @@ -1,7 +1,7 @@
>  /** @file
>    Provides interface to advanced shell functionality for parsing both handle
> and protocol database.
> 
> -  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
>    (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
>    (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
>    This program and the accompanying materials
> @@ -1042,27 +1042,27 @@ FirmwareManagementDumpInformation (
>        } else {
>          AttributeSettingStr = CatSPrint (NULL, L"(");
> 
> -        if (AttributeSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) {
> +        if ((AttributeSetting & IMAGE_ATTRIBUTE_IMAGE_UPDATABLE) != 0x0) {
>            TempRetVal = CatSPrint (AttributeSettingStr, L"
> IMAGE_ATTRIBUTE_IMAGE_UPDATABLE");
>            SHELL_FREE_NON_NULL (AttributeSettingStr);
>            AttributeSettingStr = TempRetVal;
>          }
> -        if (AttributeSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) {
> +        if ((AttributeSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) != 0x0) {
>            TempRetVal = CatSPrint (AttributeSettingStr, L"
> IMAGE_ATTRIBUTE_RESET_REQUIRED");
>            SHELL_FREE_NON_NULL (AttributeSettingStr);
>            AttributeSettingStr = TempRetVal;
>          }
> -        if (AttributeSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED) {
> +        if ((AttributeSetting & IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED)
> != 0x0) {
>            TempRetVal = CatSPrint (AttributeSettingStr, L"
> IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED");
>            SHELL_FREE_NON_NULL (AttributeSettingStr);
>            AttributeSettingStr = TempRetVal;
>          }
> -        if (AttributeSetting & IMAGE_ATTRIBUTE_IN_USE) {
> +        if ((AttributeSetting & IMAGE_ATTRIBUTE_IN_USE) != 0x0) {
>            TempRetVal = CatSPrint (AttributeSettingStr, L"
> IMAGE_ATTRIBUTE_IN_USE");
>            SHELL_FREE_NON_NULL (AttributeSettingStr);
>            AttributeSettingStr = TempRetVal;
>          }
> -        if (AttributeSetting & IMAGE_ATTRIBUTE_UEFI_IMAGE) {
> +        if ((AttributeSetting & IMAGE_ATTRIBUTE_UEFI_IMAGE) != 0x0) {
>            TempRetVal = CatSPrint (AttributeSettingStr, L"
> IMAGE_ATTRIBUTE_UEFI_IMAGE");
>            SHELL_FREE_NON_NULL (AttributeSettingStr);
>            AttributeSettingStr = TempRetVal;
> @@ -1198,7 +1198,7 @@ ENDLOOP:
>    //
>    // Check if ImageId with duplicate value was found
>    //
> -  if (Found == TRUE) {
> +  if (Found) {
>      TempStr = HiiGetString (mHandleParsingHiiHandle,
> STRING_TOKEN(STR_FMP_IMAGEID_NON_UNIQUE), NULL);
>      if (TempStr == NULL) {
>        goto ERROR_EXIT;
> --
> 2.7.1.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to