From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1BDD9817E2 for ; Fri, 6 Jan 2017 00:54:30 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 06 Jan 2017 00:54:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,323,1477983600"; d="scan'208";a="1079843849" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 06 Jan 2017 00:54:29 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Jan 2017 00:54:29 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Jan 2017 00:54:28 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.59]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Fri, 6 Jan 2017 16:54:06 +0800 From: "Ni, Ruiyu" To: "Wu, Hao A" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] MdeModulePkg/UefiBootManagerLib: Remove redundant type cast Thread-Index: AQHSZ/pMUp4lyXsGmkS+ijlT+ndRpaErJMTg Date: Fri, 6 Jan 2017 08:54:06 +0000 Deferred-Delivery: Fri, 6 Jan 2017 08:54:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5B87670D@SHSMSX104.ccr.corp.intel.com> References: <1483692781-24460-1-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1483692781-24460-1-git-send-email-hao.a.wu@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTMxMzFlMjctMWJkNS00NjdlLTgzNzAtMmIyZTVkZDY3ZTllIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiJJTXJnUWlUS0pheUdMdHphWmd1eEJOdjFmVzdPQWNTZnVIRzl3MFlTS3dnPSJ9 x-ctpclassification: CTP_PUBLIC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/UefiBootManagerLib: Remove redundant type cast X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 08:54:30 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Regards, Ray >-----Original Message----- >From: Wu, Hao A >Sent: Friday, January 6, 2017 4:53 PM >To: edk2-devel@lists.01.org >Cc: Wu, Hao A ; Ni, Ruiyu >Subject: [PATCH] MdeModulePkg/UefiBootManagerLib: Remove redundant type ca= st > >The type of return value for function EfiBootManagerFindLoadOption() is >INTN. When checking its return value, it is unnecessary to type cast -1 to >type UINTN. > >Cc: Ruiyu Ni >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Hao Wu >--- > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c >b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c >index 6b84b85..75bd5dc 100644 >--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c >+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c >@@ -1,7 +1,7 @@ > /** @file > Library functions which relates with booting. > >-Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
>+Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
> (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD= License >@@ -2152,7 +2152,7 @@ EfiBootManagerRefreshAllBootOption ( > // Only check those added by BDS > // so that the boot options added by end-user or OS installer won't= be deleted > // >- if (EfiBootManagerFindLoadOption (&NvBootOptions[Index], BootOption= s, BootOptionCount) =3D=3D (UINTN) -1) { >+ if (EfiBootManagerFindLoadOption (&NvBootOptions[Index], BootOption= s, BootOptionCount) =3D=3D -1) { > Status =3D EfiBootManagerDeleteLoadOptionVariable (NvBootOptions[= Index].OptionNumber, LoadOptionTypeBoot); > // > // Deleting variable with current variable implementation shouldn= 't fail. >@@ -2166,7 +2166,7 @@ EfiBootManagerRefreshAllBootOption ( > // Add new EFI boot options to NV > // > for (Index =3D 0; Index < BootOptionCount; Index++) { >- if (EfiBootManagerFindLoadOption (&BootOptions[Index], NvBootOptions,= NvBootOptionCount) =3D=3D (UINTN) -1) { >+ if (EfiBootManagerFindLoadOption (&BootOptions[Index], NvBootOptions,= NvBootOptionCount) =3D=3D -1) { > EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN) -= 1); > // > // Try best to add the boot options so continue upon failure. >-- >1.9.5.msysgit.0