From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from huawei.com (huawei.com [45.249.212.190]) by mx.groups.io with SMTP id smtpd.web11.5361.1599620870290334477 for ; Tue, 08 Sep 2020 20:07:51 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: huawei.com, ip: 45.249.212.190, mailfrom: xiewenyi2@huawei.com) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4177B9E7A8E78F36B553; Wed, 9 Sep 2020 11:07:45 +0800 (CST) Received: from HGH1000039998.huawei.com (10.184.68.188) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Wed, 9 Sep 2020 11:07:39 +0800 From: "wenyi,xie" To: , , , CC: , , , Subject: [PATCH edk2-Platform v2 1/1] Hisilicon/Smbios: Replace DEPRECATED code with S-suffixed one Date: Wed, 9 Sep 2020 11:03:12 +0800 Message-ID: <1599620592-5056-2-git-send-email-xiewenyi2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1599620592-5056-1-git-send-email-xiewenyi2@huawei.com> References: <1599620592-5056-1-git-send-email-xiewenyi2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.184.68.188] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2777 The deprecated code under DISABLE_NEW_DEPRECATED_INTERFACES will be removed, which will result in compilation breakage of the Hisilicon platforms. Prevent that by switching to S-suffixed one. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Wenyi Xie --- Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.c = | 2 +- Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClass.c = | 12 ++++++------ Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.= c | 14 +++++++------- Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunc= tion.c | 6 +++--- Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufact= urerFunction.c | 12 ++++++------ Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManuf= acturerFunction.c | 12 ++++++------ Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufac= turerFunction.c | 10 +++++----- Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSystemSlotDesi= gnationFunction.c | 2 +- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosTyp= e9.c b/Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.c index 57e049a41da0..4c8c693db039 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.c +++ b/Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.c @@ -135,7 +135,7 @@ AddSmbiosType9Record ( (VOID)CopyMem (SmbiosRecord, Type9Record, sizeof (SMBIOS_TABLE_TYPE9))= ; SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE9); OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - (VOID)UnicodeStrToAsciiStr (SlotDesignation, OptionalStrStart); + UnicodeStrToAsciiStrS (SlotDesignation, OptionalStrStart, SlotStrLen += 1); =20 // // Now we have got the full smbios record, call smbios protocol to add= this record. diff --git a/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySub= Class.c b/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubCla= ss.c index a1af02047409..f438ddcb5dd6 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClass.c +++ b/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClass.c @@ -625,12 +625,12 @@ SmbiosAddType17Table ( SmbiosGetDimmVoltageInfo (pGblData, Skt, Ch, Dimm, Type17Record); =20 OptionalStrStart =3D (CHAR8 *) (Type17Record + 1); - UnicodeStrToAsciiStr (DeviceLocatorStr, OptionalStrStart); - UnicodeStrToAsciiStr (BankLocatorStr, OptionalStrStart + DeviceLocat= orStrLen + 1); - UnicodeStrToAsciiStr (ManufactureStr, OptionalStrStart + DeviceLocat= orStrLen + 1 + BankLocatorStrLen + 1); - UnicodeStrToAsciiStr (SerialNumberStr, OptionalStrStart + DeviceLoca= torStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1); - UnicodeStrToAsciiStr (AssertTagStr, OptionalStrStart + DeviceLocator= StrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1 + SerialNumber= StrLen + 1); - UnicodeStrToAsciiStr (PartNumberStr, OptionalStrStart + DeviceLocato= rStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1 + SerialNumbe= rStrLen + 1 + AssertTagStrLen + 1); + UnicodeStrToAsciiStrS (DeviceLocatorStr, OptionalStrStart, DeviceLoc= atorStrLen + 1); + UnicodeStrToAsciiStrS (BankLocatorStr, OptionalStrStart + DeviceLoca= torStrLen + 1, BankLocatorStrLen + 1); + UnicodeStrToAsciiStrS (ManufactureStr, OptionalStrStart + DeviceLoca= torStrLen + 1 + BankLocatorStrLen + 1, ManufactureStrLen + 1); + UnicodeStrToAsciiStrS (SerialNumberStr, OptionalStrStart + DeviceLoc= atorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1, SerialNum= berStrLen + 1); + UnicodeStrToAsciiStrS (AssertTagStr, OptionalStrStart + DeviceLocato= rStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1 + SerialNumbe= rStrLen + 1, AssertTagStrLen + 1); + UnicodeStrToAsciiStrS (PartNumberStr, OptionalStrStart + DeviceLocat= orStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen + 1 + SerialNumb= erStrLen + 1 + AssertTagStrLen + 1, PartNumberStrLen + 1); =20 MemDevSmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; Status =3D mSmbios->Add (mSmbios, NULL, &MemDevSmbiosHandle, (EFI_SM= BIOS_TABLE_HEADER*) Type17Record); diff --git a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/Proces= sorSubClass.c b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/Pro= cessorSubClass.c index 647632f15ac2..0aa206d79cbb 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubC= lass.c +++ b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubC= lass.c @@ -391,7 +391,7 @@ AddSmbiosCacheTypeTable ( (VOID)CopyMem(Type7Record, &mSmbiosCacheTable[CacheLevel], sizeo= f (SMBIOS_TABLE_TYPE7)); =20 OptionalStrStart =3D (CHAR8 *) (Type7Record + 1); - UnicodeStrToAsciiStr (CacheSocketStr, OptionalStrStart); + UnicodeStrToAsciiStrS (CacheSocketStr, OptionalStrStart, CacheSo= cketStrLen + 1); =20 SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; Status =3D mSmbios->Add (mSmbios, NULL, &SmbiosHandle, (EFI_SMBI= OS_TABLE_HEADER *)Type7Record); @@ -610,12 +610,12 @@ AddSmbiosProcessorTypeTable ( *ProcessorId =3D ArmReadMidr(); =20 OptionalStrStart =3D (CHAR8 *) (Type4Record + 1); - UnicodeStrToAsciiStr (ProcessorSocketStr, OptionalStrStart); - UnicodeStrToAsciiStr (ProcessorManuStr, OptionalStrStart + Processor= SocketStrLen + 1); - UnicodeStrToAsciiStr (ProcessorVersionStr, OptionalStrStart + Proces= sorSocketStrLen + 1 + ProcessorManuStrLen + 1); - UnicodeStrToAsciiStr (SerialNumberStr, OptionalStrStart + ProcessorS= ocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1); - UnicodeStrToAsciiStr (AssetTagStr, OptionalStrStart + ProcessorSocke= tStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1 + Seri= alNumberStrLen + 1); - UnicodeStrToAsciiStr (PartNumberStr, OptionalStrStart + ProcessorSoc= ketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1 + Se= rialNumberStrLen + 1 + AssetTagStrLen + 1); + UnicodeStrToAsciiStrS (ProcessorSocketStr, OptionalStrStart, Process= orSocketStrLen + 1); + UnicodeStrToAsciiStrS (ProcessorManuStr, OptionalStrStart + Processo= rSocketStrLen + 1, ProcessorManuStrLen + 1); + UnicodeStrToAsciiStrS (ProcessorVersionStr, OptionalStrStart + Proce= ssorSocketStrLen + 1 + ProcessorManuStrLen + 1, ProcessorVersionStrLen + = 1); + UnicodeStrToAsciiStrS (SerialNumberStr, OptionalStrStart + Processor= SocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1, = SerialNumberStrLen + 1); + UnicodeStrToAsciiStrS (AssetTagStr, OptionalStrStart + ProcessorSock= etStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1 + Ser= ialNumberStrLen + 1, AssetTagStrLen + 1); + UnicodeStrToAsciiStrS (PartNumberStr, OptionalStrStart + ProcessorSo= cketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersionStrLen + 1 + S= erialNumberStrLen + 1 + AssetTagStrLen + 1, PartNumberStrLen + 1); =20 SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; Status =3D mSmbios->Add (mSmbios, NULL, &SmbiosHandle, (EFI_SMBIOS_T= ABLE_HEADER *)Type4Record); diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBi= osVendorFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type0= 0/MiscBiosVendorFunction.c index b62ec1dd8fdf..abd766ac8ad9 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendo= rFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendo= rFunction.c @@ -213,9 +213,9 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor) SmbiosRecord->BiosSize =3D Base2ToByteWith64KUnit(BiosPhysicalSizeHe= xValue) - 1; =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(Vendor, OptionalStrStart); - UnicodeStrToAsciiStr(Version, OptionalStrStart + VendorStrLen + 1); - UnicodeStrToAsciiStr(ReleaseDate, OptionalStrStart + VendorStrLen + = 1 + VerStrLen + 1); + UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorStrLen + 1); + UnicodeStrToAsciiStrS (Version, OptionalStrStart + VendorStrLen + 1,= VerStrLen + 1); + UnicodeStrToAsciiStrS (ReleaseDate, OptionalStrStart + VendorStrLen = + 1 + VerStrLen + 1, DateStrLen + 1); // // Now we have got the full smbios record, call smbios protocol to a= dd this record. // diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSy= stemManufacturerFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscD= xe/Type01/MiscSystemManufacturerFunction.c index f829b09d9cb7..4c16afa04206 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSystemMan= ufacturerFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSystemMan= ufacturerFunction.c @@ -135,12 +135,12 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) } =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart); - UnicodeStrToAsciiStr(ProductName, OptionalStrStart + ManuStrLen + 1= ); - UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1= + PdNameStrLen + 1); - UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1= + PdNameStrLen + 1 + VerStrLen + 1); - UnicodeStrToAsciiStr(SKUNumber, OptionalStrStart + ManuStrLen + 1= + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1); - UnicodeStrToAsciiStr(Family, OptionalStrStart + ManuStrLen + 1= + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SKUNumStrLen = + 1); + UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + = 1); + UnicodeStrToAsciiStrS (ProductName, OptionalStrStart + ManuStrLen += 1, PdNameStrLen + 1); + UnicodeStrToAsciiStrS (Version, OptionalStrStart + ManuStrLen += 1 + PdNameStrLen + 1, VerStrLen + 1); + UnicodeStrToAsciiStrS (SerialNumber, OptionalStrStart + ManuStrLen += 1 + PdNameStrLen + 1 + VerStrLen + 1, SerialNumStrLen + 1); + UnicodeStrToAsciiStrS (SKUNumber, OptionalStrStart + ManuStrLen += 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1, SKUNumStrLen= + 1); + UnicodeStrToAsciiStrS (Family, OptionalStrStart + ManuStrLen += 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SKUNumStrLe= n + 1, FamilyStrLen + 1); =20 // // Now we have got the full smbios record, call smbios protocol to a= dd this record. diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBa= seBoardManufacturerFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMi= scDxe/Type02/MiscBaseBoardManufacturerFunction.c index 3834bf93f70b..20bb001bb33c 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoard= ManufacturerFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoard= ManufacturerFunction.c @@ -142,12 +142,12 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacture= r) FreePool(HandleArray); =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(BaseBoardManufacturer, OptionalStrStart); - UnicodeStrToAsciiStr(BaseBoardProductName, OptionalStrStart + ManuS= trLen + 1); - UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuS= trLen + 1 + ProductNameStrLen + 1); - UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuS= trLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1); - UnicodeStrToAsciiStr(AssetTag, OptionalStrStart + ManuS= trLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 )= ; - UnicodeStrToAsciiStr(ChassisLocation, OptionalStrStart + ManuS= trLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 += AssetTagStrLen + 1); + UnicodeStrToAsciiStrS (BaseBoardManufacturer, OptionalStrStart, Manu= StrLen + 1); + UnicodeStrToAsciiStrS (BaseBoardProductName, OptionalStrStart + Man= uStrLen + 1, ProductNameStrLen + 1); + UnicodeStrToAsciiStrS (Version, OptionalStrStart + Man= uStrLen + 1 + ProductNameStrLen + 1, VerStrLen + 1); + UnicodeStrToAsciiStrS (SerialNumber, OptionalStrStart + Man= uStrLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1, SerialNumStrLen + 1)= ; + UnicodeStrToAsciiStrS (AssetTag, OptionalStrStart + Man= uStrLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1= , AssetTagStrLen + 1); + UnicodeStrToAsciiStrS (ChassisLocation, OptionalStrStart + Man= uStrLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1= + AssetTagStrLen + 1, ChassisLocaStrLen + 1); =20 Status =3D LogSmbiosData( (UINT8*)SmbiosRecord, &SmbiosHandle); if(EFI_ERROR(Status)) diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscCh= assisManufacturerFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMisc= Dxe/Type03/MiscChassisManufacturerFunction.c index ec00e1cd10ad..cd98cc966322 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscChassisMa= nufacturerFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscChassisMa= nufacturerFunction.c @@ -147,11 +147,11 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer) *((UINT8 *)SmbiosRecord + sizeof (SMBIOS_TABLE_TYPE3) + ExtendLength= ) =3D 5; =20 OptionalStrStart =3D (CHAR8 *)((UINT8 *)SmbiosRecord + sizeof (SMBIO= S_TABLE_TYPE3) + ExtendLength + 1); - UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart); - UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen= + 1); - UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen= + 1 + VerStrLen + 1); - UnicodeStrToAsciiStr(AssertTag, OptionalStrStart + ManuStrLen= + 1 + VerStrLen + 1 + SerialNumStrLen + 1); - UnicodeStrToAsciiStr(ChassisSkuNumber, OptionalStrStart + ManuStrLen= + 1 + VerStrLen + 1 + SerialNumStrLen +1 + AssertTagStrLen + 1); + UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLe= n + 1); + UnicodeStrToAsciiStrS (Version, OptionalStrStart + ManuStrL= en + 1, VerStrLen + 1); + UnicodeStrToAsciiStrS (SerialNumber, OptionalStrStart + ManuStrL= en + 1 + VerStrLen + 1, SerialNumStrLen + 1); + UnicodeStrToAsciiStrS (AssertTag, OptionalStrStart + ManuStrL= en + 1 + VerStrLen + 1 + SerialNumStrLen + 1, AssertTagStrLen + 1); + UnicodeStrToAsciiStrS (ChassisSkuNumber, OptionalStrStart + ManuStrL= en + 1 + VerStrLen + 1 + SerialNumStrLen +1 + AssertTagStrLen + 1, ChaNum= StrLen + 1); // // Now we have got the full smbios record, call smbios protocol to a= dd this record. // diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSy= stemSlotDesignationFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMi= scDxe/Type09/MiscSystemSlotDesignationFunction.c index ca1a7a2c0055..e03b28d2f6aa 100644 --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSystemSlo= tDesignationFunction.c +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSystemSlo= tDesignationFunction.c @@ -172,7 +172,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemSlotDesignation) SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE9); =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); - UnicodeStrToAsciiStr(SlotDesignation, OptionalStrStart); + UnicodeStrToAsciiStrS (SlotDesignation, OptionalStrStart, SlotDesign= ationStrLen + 1); // // Now we have got the full smbios record, call smbios protocol to a= dd this record. // --=20 2.20.1.windows.1