From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 5A4A221A0483A for ; Sun, 23 Apr 2017 22:50:26 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 23 Apr 2017 22:50:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,243,1488873600"; d="scan'208";a="78021714" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 23 Apr 2017 22:50:25 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 23 Apr 2017 22:50:25 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 23 Apr 2017 22:50:24 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.246]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Mon, 24 Apr 2017 13:50:23 +0800 From: "Zeng, Star" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [edk2] [PATCH 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart Thread-Index: AQHSvL4Wv1lwnZZs+Ue4Zxtk8f5u86HUAy7Q Date: Mon, 24 Apr 2017 05:50:22 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B87DA51@shsmsx102.ccr.corp.intel.com> References: <20170424054557.6992-1-hao.a.wu@intel.com> <20170424054557.6992-3-hao.a.wu@intel.com> In-Reply-To: <20170424054557.6992-3-hao.a.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return value in BindingStart X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Apr 2017 05:50:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hao, ASSERT_EFI_ERROR will be null macro in release mode, but the code still nee= ds to be run in release mode. I recommend to just remove the Status assignment and ASSERT_EFI_ERROR in th= e original PCI attributes restore code. Thanks, Star -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Hao = Wu Sent: Monday, April 24, 2017 1:46 PM To: edk2-devel@lists.01.org Cc: Wu, Hao A ; Zeng, Star Subject: [edk2] [PATCH 2/2] MdeModulePkg/UfsPciHc: Avoid overriding return = value in BindingStart In function UfsHcDriverBindingStart(), the return value 'Status' may be ove= rriden during the original PCI attributes restore process. This commit refines the logics to avoid such override. Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c b/MdeModulePkg/= Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c index 373e55b4c2..241d9bac9f 100644 --- a/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c +++ b/MdeModulePkg/Bus/Pci/UfsPciHcDxe/UfsPciHcDxe.c @@ -671,13 +671,12 @@ Done: // // Restore original PCI attributes // - Status =3D PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationSet, - Private->PciAttributes, - NULL - ); - ASSERT_EFI_ERROR (Status); + ASSERT_EFI_ERROR (PciIo->Attributes ( + PciIo, + EfiPciIoAttributeOperationSet, + Private->PciAttributes, + NULL + )); } gBS->CloseProtocol ( Controller, -- 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel