From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from huawei.com (huawei.com [45.249.212.191]) by mx.groups.io with SMTP id smtpd.web10.8553.1599637310374234259 for ; Wed, 09 Sep 2020 00:41:52 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: huawei.com, ip: 45.249.212.191, mailfrom: xiewenyi2@huawei.com) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 417E6955B33A985D5BE5; Wed, 9 Sep 2020 15:41:45 +0800 (CST) Received: from [127.0.0.1] (10.174.153.72) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Wed, 9 Sep 2020 15:41:39 +0800 Subject: Re: [PATCH edk2-Platform v2 1/1] Hisilicon/Smbios: Replace DEPRECATED code with S-suffixed one To: Ard Biesheuvel , , , CC: , , References: <1599620592-5056-1-git-send-email-xiewenyi2@huawei.com> <1599620592-5056-2-git-send-email-xiewenyi2@huawei.com> From: "wenyi,xie" Message-ID: Date: Wed, 9 Sep 2020 15:41:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.0.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.174.153.72] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2020/9/9 15:27, Ard Biesheuvel wrote: > On 9/9/20 5:03 AM, Wenyi Xie wrote: >> 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 >=20 > The whole point of the UnicodeStrToAsciiStrS() routine is that it retur= ns a status code, and so it can fail. So please capture the return code, = and at least use ASSERT_EFI_ERROR() on it so any errors are flagged in DE= BUG mode. OK, I will add checking for return code. Thanks Wenyi >=20 >=20 >> --- >> =C2=A0 Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.= c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 |=C2=A0 2 +- >> =C2=A0 Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubCla= ss.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 12 ++++= ++------ >> =C2=A0 Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/Processor= SubClass.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 14 +++++++------- >> =C2=A0 Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBiosV= endorFunction.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 |=C2=A0 6 +++--- >> =C2=A0 Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSyste= mManufacturerFunction.c=C2=A0=C2=A0=C2=A0 | 12 ++++++------ >> =C2=A0 Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBaseB= oardManufacturerFunction.c | 12 ++++++------ >> =C2=A0 Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscChass= isManufacturerFunction.c=C2=A0=C2=A0 | 10 +++++----- >> =C2=A0 Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSyste= mSlotDesignationFunction.c |=C2=A0 2 +- >> =C2=A0 8 files changed, 35 insertions(+), 35 deletions(-) >> >> diff --git a/Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbios= Type9.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 ( >> =C2=A0=C2=A0=C2=A0 (VOID)CopyMem (SmbiosRecord, Type9Record, sizeof (S= MBIOS_TABLE_TYPE9)); >> =C2=A0=C2=A0=C2=A0 SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_T= YPE9); >> =C2=A0=C2=A0=C2=A0 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); >> -=C2=A0 (VOID)UnicodeStrToAsciiStr (SlotDesignation, OptionalStrStart)= ; >> +=C2=A0 UnicodeStrToAsciiStrS (SlotDesignation, OptionalStrStart, Slot= StrLen + 1); >> =C2=A0 =C2=A0=C2=A0=C2=A0 // >> =C2=A0=C2=A0=C2=A0 // Now we have got the full smbios record, call smb= ios protocol to add this record. >> diff --git a/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/Memory= SubClass.c b/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySub= Class.c >> index a1af02047409..f438ddcb5dd6 100644 >> --- a/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClas= s.c >> +++ b/Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClas= s.c >> @@ -625,12 +625,12 @@ SmbiosAddType17Table ( >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosGetDimmVoltageInfo (pGblData, Skt= , Ch, Dimm, Type17Record); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart =3D (CHAR8 *) (= Type17Record + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (DeviceLocatorStr, OptionalSt= rStart); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (BankLocatorStr, OptionalStrS= tart + DeviceLocatorStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (ManufactureStr, OptionalStrS= tart + DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (SerialNumberStr, OptionalStr= Start + DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrL= en + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (AssertTagStr, OptionalStrSta= rt + DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen = + 1 + SerialNumberStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (PartNumberStr, OptionalStrSt= art + DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen= + 1 + SerialNumberStrLen + 1 + AssertTagStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (DeviceLocatorStr, OptionalS= trStart, DeviceLocatorStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (BankLocatorStr, OptionalStr= Start + DeviceLocatorStrLen + 1, BankLocatorStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (ManufactureStr, OptionalStr= Start + DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1, ManufactureStrLe= n + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (SerialNumberStr, OptionalSt= rStart + DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStr= Len + 1, SerialNumberStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (AssertTagStr, OptionalStrSt= art + DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLen= + 1 + SerialNumberStrLen + 1, AssertTagStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (PartNumberStr, OptionalStrS= tart + DeviceLocatorStrLen + 1 + BankLocatorStrLen + 1 + ManufactureStrLe= n + 1 + SerialNumberStrLen + 1 + AssertTagStrLen + 1, PartNumberStrLen + = 1); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MemDevSmbiosHandle =3D SMBIOS_HA= NDLE_PI_RESERVED; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D mSmbios->Add (mSmbios, NULL,= &MemDevSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type17Record); >> diff --git a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/Pro= cessorSubClass.c b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/= ProcessorSubClass.c >> index 647632f15ac2..0aa206d79cbb 100644 >> --- a/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorS= ubClass.c >> +++ b/Silicon/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorS= ubClass.c >> @@ -391,7 +391,7 @@ AddSmbiosCacheTypeTable ( >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (VOID)CopyMem(T= ype7Record, &mSmbiosCacheTable[CacheLevel], sizeof (SMBIOS_TABLE_TYPE7)); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Optional= StrStart =3D (CHAR8 *) (Type7Record + 1); >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (Cach= eSocketStr, OptionalStrStart); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (Cac= heSocketStr, OptionalStrStart, CacheSocketStrLen + 1); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosHa= ndle =3D SMBIOS_HANDLE_PI_RESERVED; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D mSmb= ios->Add (mSmbios, NULL, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *)Type7R= ecord); >> @@ -610,12 +610,12 @@ AddSmbiosProcessorTypeTable ( >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *ProcessorId =3D ArmReadMidr(); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart =3D (CHAR8 *) (= Type4Record + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (ProcessorSocketStr, Optional= StrStart); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (ProcessorManuStr, OptionalSt= rStart + ProcessorSocketStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (ProcessorVersionStr, Optiona= lStrStart + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (SerialNumberStr, OptionalStr= Start + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVe= rsionStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (AssetTagStr, OptionalStrStar= t + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersio= nStrLen + 1 + SerialNumberStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr (PartNumberStr, OptionalStrSt= art + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVers= ionStrLen + 1 + SerialNumberStrLen + 1 + AssetTagStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (ProcessorSocketStr, Optiona= lStrStart, ProcessorSocketStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (ProcessorManuStr, OptionalS= trStart + ProcessorSocketStrLen + 1, ProcessorManuStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (ProcessorVersionStr, Option= alStrStart + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1, Process= orVersionStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (SerialNumberStr, OptionalSt= rStart + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorV= ersionStrLen + 1, SerialNumberStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (AssetTagStr, OptionalStrSta= rt + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVersi= onStrLen + 1 + SerialNumberStrLen + 1, AssetTagStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (PartNumberStr, OptionalStrS= tart + ProcessorSocketStrLen + 1 + ProcessorManuStrLen + 1 + ProcessorVer= sionStrLen + 1 + SerialNumberStrLen + 1 + AssetTagStrLen + 1, PartNumberS= trLen + 1); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosHandle =3D SMBIOS_HANDLE_P= I_RESERVED; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D mSmbios->Add (mSmbios, NULL,= &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *)Type4Record); >> diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/Mis= cBiosVendorFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Ty= pe00/MiscBiosVendorFunction.c >> index b62ec1dd8fdf..abd766ac8ad9 100644 >> --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBiosVe= ndorFunction.c >> +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type00/MiscBiosVe= ndorFunction.c >> @@ -213,9 +213,9 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosRecord->BiosSize =3D Base2ToByteW= ith64KUnit(BiosPhysicalSizeHexValue) - 1; >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart =3D (CHAR8 *)(S= mbiosRecord + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(Vendor, OptionalStrStart); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(Version, OptionalStrStart + V= endorStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(ReleaseDate, OptionalStrStart= + VendorStrLen + 1 + VerStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, V= endorStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (Version, OptionalStrStart += VendorStrLen + 1, VerStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (ReleaseDate, OptionalStrSta= rt + VendorStrLen + 1 + VerStrLen + 1, DateStrLen + 1); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Now we have got the full smbios reco= rd, call smbios protocol to add this record. >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/Mis= cSystemManufacturerFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMi= scDxe/Type01/MiscSystemManufacturerFunction.c >> index f829b09d9cb7..4c16afa04206 100644 >> --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSystem= ManufacturerFunction.c >> +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type01/MiscSystem= ManufacturerFunction.c >> @@ -135,12 +135,12 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacture= r) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart =3D (CHAR8 *)(S= mbiosRecord + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(Manufacturer, OptionalStrStar= t); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(ProductName,=C2=A0 OptionalSt= rStart + ManuStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(Version,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(SerialNumber, OptionalStrStar= t + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(SKUNumber,=C2=A0=C2=A0=C2=A0 = OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + Se= rialNumStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(Family,=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerSt= rLen + 1 + SerialNumStrLen + 1 + SKUNumStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (Manufacturer, OptionalStrSt= art, ManuStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (ProductName,=C2=A0 Optional= StrStart + ManuStrLen + 1, PdNameStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (Version,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1, VerStrLen= + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (SerialNumber, OptionalStrSt= art + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1, SerialNumStrLen = + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (SKUNumber,=C2=A0=C2=A0=C2=A0= OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + S= erialNumStrLen + 1, SKUNumStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (Family,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + Ve= rStrLen + 1 + SerialNumStrLen + 1 + SKUNumStrLen + 1, FamilyStrLen + 1); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Now we have got the full smbios reco= rd, call smbios protocol to add this record. >> diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/Mis= cBaseBoardManufacturerFunction.c b/Silicon/Hisilicon/Drivers/Smbios/Smbio= sMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c >> index 3834bf93f70b..20bb001bb33c 100644 >> --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBaseBo= ardManufacturerFunction.c >> +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type02/MiscBaseBo= ardManufacturerFunction.c >> @@ -142,12 +142,12 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufact= urer) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FreePool(HandleArray); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart =3D (CHAR8 *)(S= mbiosRecord + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(BaseBoardManufacturer, Option= alStrStart); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(BaseBoardProductName,=C2=A0 O= ptionalStrStart + ManuStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(Version,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalS= trStart + ManuStrLen + 1 + ProductNameStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(SerialNumber,=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + = ProductNameStrLen + 1 + VerStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(AssetTag,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStar= t + ManuStrLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNumStr= Len + 1 ); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(ChassisLocation,=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + ProductNameStrL= en + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (BaseBoardManufacturer, Opti= onalStrStart, ManuStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (BaseBoardProductName,=C2=A0= OptionalStrStart + ManuStrLen + 1, ProductNameStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (Version,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalS= trStart + ManuStrLen + 1 + ProductNameStrLen + 1, VerStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (SerialNumber,=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1= + ProductNameStrLen + 1 + VerStrLen + 1, SerialNumStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (AssetTag,=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrS= tart + ManuStrLen + 1 + ProductNameStrLen + 1 + VerStrLen + 1 + SerialNum= StrLen + 1, AssetTagStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (ChassisLocation,=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + ProductNameS= trLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssetTagStrLen + 1, Cha= ssisLocaStrLen + 1); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D LogSmbiosData( (UINT8= *)SmbiosRecord, &SmbiosHandle); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if(EFI_ERROR(Status)) >> diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/Mis= cChassisManufacturerFunction.c b/Silicon/Hisilicon/Drivers/Smbios/SmbiosM= iscDxe/Type03/MiscChassisManufacturerFunction.c >> index ec00e1cd10ad..cd98cc966322 100644 >> --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscChassi= sManufacturerFunction.c >> +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type03/MiscChassi= sManufacturerFunction.c >> @@ -147,11 +147,11 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufactur= er) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *((UINT8 *)SmbiosRecord + sizeof (SMBIO= S_TABLE_TYPE3) + ExtendLength) =3D 5; >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart =3D (CHAR8 *)((= UINT8 *)SmbiosRecord + sizeof (SMBIOS_TABLE_TYPE3) + ExtendLength + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(Manufacturer,=C2=A0=C2=A0=C2=A0= =C2=A0 OptionalStrStart); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(Version,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(SerialNumber,=C2=A0=C2=A0=C2=A0= =C2=A0 OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(AssertTag,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1 += SerialNumStrLen + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(ChassisSkuNumber, OptionalStr= Start + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen +1 + AssertTagSt= rLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (Manufacturer,=C2=A0=C2=A0=C2= =A0=C2=A0 OptionalStrStart, ManuStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (Version,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1, VerS= trLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (SerialNumber,=C2=A0=C2=A0=C2= =A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1, SerialNumStr= Len + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (AssertTag,=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart + ManuStrLen + 1 + VerStrLen + = 1 + SerialNumStrLen + 1, AssertTagStrLen + 1); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (ChassisSkuNumber, OptionalS= trStart + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen +1 + AssertTag= StrLen + 1, ChaNumStrLen + 1); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Now we have got the full smbios reco= rd, call smbios protocol to add this record. >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> diff --git a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/Mis= cSystemSlotDesignationFunction.c b/Silicon/Hisilicon/Drivers/Smbios/Smbio= sMiscDxe/Type09/MiscSystemSlotDesignationFunction.c >> index ca1a7a2c0055..e03b28d2f6aa 100644 >> --- a/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSystem= SlotDesignationFunction.c >> +++ b/Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/Type09/MiscSystem= SlotDesignationFunction.c >> @@ -172,7 +172,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemSlotDesignati= on) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosRecord->Hdr.Length =3D sizeof (SM= BIOS_TABLE_TYPE9); >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 OptionalStrStart =3D (CHAR8 *)(S= mbiosRecord + 1); >> -=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStr(SlotDesignation, OptionalStrS= tart); >> +=C2=A0=C2=A0=C2=A0 UnicodeStrToAsciiStrS (SlotDesignation, OptionalSt= rStart, SlotDesignationStrLen + 1); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Now we have got the full smbios reco= rd, call smbios protocol to add this record. >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // >> >=20 >=20 > .