diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index 64bbe4c799..9c497e9606 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -1128,33 +1128,36 @@ GetSkuIdArray ( } - /** - Get index of PCD entry in size table. - + Wrapper function of getting index of PCD entry in size table. + @param LocalTokenNumberTableIdx Index of this PCD in local token number table. - @param LocalTokenNumberTable Pointer to local token number table in PCD database. @param IsPeiDb If TRUE, the pcd entry is initialized in PEI phase, If FALSE, the pcd entry is initialized in DXE phase. @return index of PCD entry in size table. - **/ UINTN -GetSizeTableIndexA ( - IN UINTN LocalTokenNumberTableIdx, - IN UINT32 *LocalTokenNumberTable, - IN BOOLEAN IsPeiDb +GetSizeTableIndex ( + IN UINTN LocalTokenNumberTableIdx, + IN BOOLEAN IsPeiDb ) { - UINTN Index; - UINTN SizeTableIdx; - UINTN LocalTokenNumber; - SKU_ID *SkuIdTable; + UINT32 *LocalTokenNumberTable; + UINTN LocalTokenNumber; + UINTN Index; + UINTN SizeTableIdx; + SKU_ID *SkuIdTable; + if (IsPeiDb) { + LocalTokenNumberTable = mPcdDatabase->PeiDb.Init.LocalTokenNumberTable; + } else { + LocalTokenNumberTable = mPcdDatabase->DxeDb.Init.LocalTokenNumberTable; + } + SizeTableIdx = 0; - for (Index=0; IndexPeiDb.Init.LocalTokenNumberTable; - } else { - LocalTokenNumberTable = mPcdDatabase->DxeDb.Init.LocalTokenNumberTable; - } - return GetSizeTableIndexA (LocalTokenNumberTableIdx, - LocalTokenNumberTable, - IsPeiDb); + return SizeTableIdx; } /**