From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 175FD21A16EFF for ; Sun, 4 Jun 2017 23:55:08 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2017 23:56:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,299,1493708400"; d="scan'208,217";a="1178332238" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 04 Jun 2017 23:56:12 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 4 Jun 2017 23:56:12 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 4 Jun 2017 23:56:12 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.122]) with mapi id 14.03.0319.002; Mon, 5 Jun 2017 14:56:10 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdePkg SmmIoLib: Use NULL pointer check instead of useless Status check Thread-Index: AQHS3cbM6A0FUg3kIEO4/tFnsyYnhKIV0opg Date: Mon, 5 Jun 2017 06:56:09 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A9637D9@shsmsx102.ccr.corp.intel.com> References: <1496644870-31620-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1496644870-31620-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: [PATCH] MdePkg SmmIoLib: Use NULL pointer check instead of useless Status check 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, 05 Jun 2017 06:55:08 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of St= ar > Zeng > Sent: Monday, June 5, 2017 2:41 PM > To: edk2-devel@lists.01.org > Cc: Yao, Jiewen ; Zeng, Star > Subject: [edk2] [PATCH] MdePkg SmmIoLib: Use NULL pointer check instead o= f > useless Status check > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D587 > > The Status check in "if (!EFI_ERROR (Status))" condition is useless, > it should be NULL pointer check. And this patch also fixes a typo > "continous" to "continuous". > > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Star Zeng > --- > MdePkg/Library/SmmIoLib/SmmIoLib.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/MdePkg/Library/SmmIoLib/SmmIoLib.c > b/MdePkg/Library/SmmIoLib/SmmIoLib.c > index 181abb8e25df..f1cb0dace500 100644 > --- a/MdePkg/Library/SmmIoLib/SmmIoLib.c > +++ b/MdePkg/Library/SmmIoLib/SmmIoLib.c > @@ -156,7 +156,7 @@ SmmIsMmioValid ( > } > > /** > - Merge continous entries whose type is > EfiGcdMemoryTypeMemoryMappedIo. > + Merge continuous entries whose type is > EfiGcdMemoryTypeMemoryMappedIo. > > @param[in, out] GcdMemoryMap A pointer to the buffer in > which firmware places > the current GCD memory map. > @@ -217,7 +217,8 @@ MergeGcdMmioEntry ( > @param[in] Interface Points to the interface instance. > @param[in] Handle The handle on which the interface was installed. > > - @retval EFI_SUCCESS Notification runs successfully. > + @retval EFI_SUCCESS Notification runs successfully. > + @retval EFI_OUT_OF_RESOURCES No enough resources to save GCD > MMIO map. > **/ > EFI_STATUS > EFIAPI > @@ -237,10 +238,10 @@ SmmIoLibInternalEndOfDxeNotify ( > MergeGcdMmioEntry (MemSpaceMap, &NumberOfDescriptors); > > mSmmIoLibGcdMemSpace =3D AllocateCopyPool (NumberOfDescriptors * > sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR), MemSpaceMap); > - ASSERT_EFI_ERROR (Status); > - if (EFI_ERROR (Status)) { > + ASSERT (mSmmIoLibGcdMemSpace !=3D NULL); > + if (mSmmIoLibGcdMemSpace =3D=3D NULL) { > gBS->FreePool (MemSpaceMap); > - return Status; > + return EFI_OUT_OF_RESOURCES; > } > > mSmmIoLibGcdMemNumberOfDesc =3D NumberOfDescriptors; > -- > 2.7.0.windows.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel