From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: chasel.chiu@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Thu, 01 Aug 2019 23:59:05 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2019 23:59:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,337,1559545200"; d="scan'208";a="167151588" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by orsmga008.jf.intel.com with ESMTP; 01 Aug 2019 23:59:03 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.22]) by PGSMSX108.gar.corp.intel.com ([169.254.8.190]) with mapi id 14.03.0439.000; Fri, 2 Aug 2019 14:59:02 +0800 From: "Chiu, Chasel" To: "Cheng, Ching JenX" , "devel@edk2.groups.io" CC: "Chan, Amy" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [PATCH v2] * IntelFsp2Pkg: Improve FSP Python scripts to support 3.x. Thread-Topic: [PATCH v2] * IntelFsp2Pkg: Improve FSP Python scripts to support 3.x. Thread-Index: AQHVSFDRP2L4XYLF806+EiaW/zyRtqbnbs4Q Date: Fri, 2 Aug 2019 06:59:01 +0000 Message-ID: <3C3EFB470A303B4AB093197B6777CCEC50451F92@PGSMSX111.gar.corp.intel.com> References: <20190801100702.11484-1-ching.jenx.cheng@intel.com> In-Reply-To: <20190801100702.11484-1-ching.jenx.cheng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjA0ZjE2YTktYTMwYy00NDZmLWE4ZjctOTgzNjBkNDJhOTVlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNFVOOHBSbzNBOG00ckRIV2VrUVpDNE9EOHdtZHVrXC85c20yTDhkam5WcmlXcHNMMEtTYWpBeW90VjZFU2hXNjgifQ== x-ctpclassification: CTP_NT x-originating-ip: [172.30.20.205] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Patch submitted: 5e4ebd9ea5d72c1a2824d23a5dc92c7b50694719 Thanks! Chasel > -----Original Message----- > From: Cheng, Ching JenX > Sent: Thursday, August 1, 2019 6:07 PM > To: devel@edk2.groups.io > Cc: Chan, Amy ; Chiu, Chasel ; > Desimone, Nathaniel L ; Zeng, Star > > Subject: [PATCH v2] * IntelFsp2Pkg: Improve FSP Python scripts to support= 3.x. >=20 > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2041 >=20 > [PATCH v2] Update commit message for more detail description >=20 > When running with Python 3.x and relying on GenCfgOpt.py to automatically > assign UPD offsets, the script crashed because some float type variable n= ot > compatible with the operations. > Convert those float variable to int to fix these issues. >=20 > Cc: Amy Chan > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Signed-off-by: Ching JenX Cheng > --- > IntelFsp2Pkg/Tools/GenCfgOpt.py | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py > b/IntelFsp2Pkg/Tools/GenCfgOpt.py index a42717caae..2fa7582d85 100644 > --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py > +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py > @@ -715,7 +715,7 @@ EndList > if (ConfigDict['embed'].find(':END') !=3D -1): > Remainder =3D Offset % (MaxAlign/8) # MaxA= lign is either > 32 or 64 > if Remainder: > - Diff =3D (MaxAlign/8) - Remainder > + Diff =3D int((MaxAlign/8) - Remainder) > Offset =3D Offset + Diff > ItemOffset =3D ItemOffset + Diff > MaxAlign =3D 32 # Rese= t to default 32 > align when struct end > @@ -727,7 +727,7 @@ EndList > Remainder =3D Offset % max(ItemLength/8, 4, = SizeAlign) > Offset =3D Offset + ItemLength > if Remainder: > - Diff =3D max(ItemLength/8, 4, SizeAlign)= - Remainder > + Diff =3D int(max(ItemLength/8, 4, > + SizeAlign) - Remainder) > ItemOffset =3D ItemOffset + Diff > ConfigDict['offset'] =3D ItemOffset >=20 > @@ -1416,7 +1416,7 @@ EndList > if BitsRemain: > BsfFd.write(" Skip %d bits\n" % BitsR= emain) > BitsGap -=3D BitsRemain > - BytesRemain =3D BitsGap / 8 > + BytesRemain =3D int(BitsGap / 8) > if BytesRemain: > BsfFd.write(" Skip %d bytes\n" % Byte= sRemain) > NextOffset =3D Item['offset'] + Item['length'] > -- > 2.21.0.windows.1