From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 C75422195406F for ; Thu, 20 Apr 2017 19:44:55 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2017 19:44:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,228,1488873600"; d="scan'208";a="1138391481" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga001.fm.intel.com with ESMTP; 20 Apr 2017 19:44:54 -0700 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Star Zeng , Jiewen Yao Date: Fri, 21 Apr 2017 10:44:51 +0800 Message-Id: <20170421024451.15584-1-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 Subject: [PATCH] MdeModulePkg/PiSmmCore: Remove redundant PoolTail pointer assignment 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: Fri, 21 Apr 2017 02:44:56 -0000 Cc: Star Zeng Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- MdeModulePkg/Core/PiSmmCore/Pool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c b/MdeModulePkg/Core/PiSmmCore/Pool.c index ebb9f8c49e..36317563c4 100644 --- a/MdeModulePkg/Core/PiSmmCore/Pool.c +++ b/MdeModulePkg/Core/PiSmmCore/Pool.c @@ -185,18 +185,19 @@ InternalAllocPoolByIndex ( Internal Function. Free a pool by specified PoolIndex. @param FreePoolHdr The pool to free. + @param PoolTail The pointer to the pool tail. @retval EFI_SUCCESS Pool successfully freed. **/ EFI_STATUS InternalFreePoolByIndex ( - IN FREE_POOL_HEADER *FreePoolHdr + IN FREE_POOL_HEADER *FreePoolHdr, + IN POOL_TAIL *PoolTail ) { UINTN PoolIndex; SMM_POOL_TYPE SmmPoolType; - POOL_TAIL *PoolTail; ASSERT ((FreePoolHdr->Header.Size & (FreePoolHdr->Header.Size - 1)) == 0); ASSERT (((UINTN)FreePoolHdr & (FreePoolHdr->Header.Size - 1)) == 0); @@ -208,7 +209,6 @@ InternalFreePoolByIndex ( FreePoolHdr->Header.Signature = 0; FreePoolHdr->Header.Available = TRUE; FreePoolHdr->Header.Type = 0; - PoolTail = HEAD_TO_TAIL(&FreePoolHdr->Header); PoolTail->Signature = 0; PoolTail->Size = 0; ASSERT (PoolIndex < MAX_POOL_INDEX); @@ -373,7 +373,7 @@ SmmInternalFreePool ( EFI_SIZE_TO_PAGES (FreePoolHdr->Header.Size) ); } - return InternalFreePoolByIndex (FreePoolHdr); + return InternalFreePoolByIndex (FreePoolHdr, PoolTail); } /** -- 2.12.0.windows.1