[edk2-devel] [PATCH] * IntelFsp2Pkg: Improve FSP Python scripts to support 3.x.
Cheng, Ching JenX
ching.jenx.cheng at intel.com
Thu Aug 1 07:02:05 UTC 2019
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2041
Improve Python3.x support with IntelFsp2Pkg/Tools/GenCfgOpt.py,
Base on <<, print('%x' % ) is only support for int, not float.
Cc: Amy Chan <amy.chan at intel.com>
Cc: Chasel Chiu <chasel.chiu at intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Cc: Star Zeng <star.zeng at intel.com>
Signed-off-by: Ching JenX Cheng <ching.jenx.cheng at intel.com>
---
IntelFsp2Pkg/Tools/GenCfgOpt.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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') != -1):
Remainder = Offset % (MaxAlign/8) # MaxAlign is either 32 or 64
if Remainder:
- Diff = (MaxAlign/8) - Remainder
+ Diff = int((MaxAlign/8) - Remainder)
Offset = Offset + Diff
ItemOffset = ItemOffset + Diff
MaxAlign = 32 # Reset to default 32 align when struct end
@@ -727,7 +727,7 @@ EndList
Remainder = Offset % max(ItemLength/8, 4, SizeAlign)
Offset = Offset + ItemLength
if Remainder:
- Diff = max(ItemLength/8, 4, SizeAlign) - Remainder
+ Diff = int(max(ItemLength/8, 4, SizeAlign) - Remainder)
ItemOffset = ItemOffset + Diff
ConfigDict['offset'] = ItemOffset
@@ -1416,7 +1416,7 @@ EndList
if BitsRemain:
BsfFd.write(" Skip %d bits\n" % BitsRemain)
BitsGap -= BitsRemain
- BytesRemain = BitsGap / 8
+ BytesRemain = int(BitsGap / 8)
if BytesRemain:
BsfFd.write(" Skip %d bytes\n" % BytesRemain)
NextOffset = Item['offset'] + Item['length']
--
2.21.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#44791): https://edk2.groups.io/g/devel/message/44791
Mute This Topic: https://groups.io/mt/32677000/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 4019 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20190801/d6d960a6/attachment.bin>
More information about the edk2-devel-archive
mailing list