From nobody Mon Apr 29 15:52:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44792+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44792+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1564659511; cv=none; d=zoho.com; s=zohoarc; b=jxO902OxwA8gwEYa6E4D+Y0O1gY8l1KP3JtqHAK+wRbNMK7wP+g2F9Fe1PLY7gMl4vWy8kHmgjIA19/8fvm0W8Y5gXwNrGvRYhcUDH4FlT9hcoDYhR3Zlh7Wfu9Ng+j6+lll8cciJqLTLgb9kcuWaQxUppFftCEnZvHSjW0uGgE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564659511; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=9qud6/wZltarLvv8Za3MvA4XRMb8WSljaKbzMrN4Qr0=; b=NsnAP6EL+R8OnS3Zg1ATvPz2Ky2LK6S552hwqz8h1Fi1o7iSGI8+BqkuEJAMbw1yCOKNlgnAwun0Opcmw3Zaz3YInVzQTmj5ZV7PWIiCGzDta4qglLEdPpKidFfSWl/2cRQlIcKeZyBqd7TKDVP5+PODNrl11nWcraMTqRwPEmk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44792+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1564659511628791.2190743864268; Thu, 1 Aug 2019 04:38:31 -0700 (PDT) Return-Path: X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Thu, 01 Aug 2019 03:06:36 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2019 03:06:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,333,1559545200"; d="scan'208";a="371976422" X-Received: from unknown (HELO chingjex-MOBL.gar.corp.intel.com) ([10.5.244.32]) by fmsmga005.fm.intel.com with ESMTP; 01 Aug 2019 03:06:33 -0700 From: "Cheng, Ching JenX" To: devel@edk2.groups.io Cc: Amy Chan , Chasel Chiu , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH v2] * IntelFsp2Pkg: Improve FSP Python scripts to support 3.x. Date: Thu, 1 Aug 2019 18:07:01 +0800 Message-Id: <20190801100702.11484-1-ching.jenx.cheng@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ching.jenx.cheng@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1564659511; bh=z+EixCm2VIa4LZ7wWBbVO3A6E01dv9+T5XexmdUES7U=; h=Cc:Date:From:Reply-To:Subject:To; b=ZRgAPIFRJD8I26UE4qfpZgmtbL49v0OZCCz28X0m8oFJa+H0OvPZWbjU96s0DAyKm1s eDMiHdUis1e1h7pYjZw7geCZltGNFPksMLYX5wsi9GCTLS0N61a7Bk1PXqiETEkI7FbJy qKbQ0OqWtK9sncN+THDVpKXb5yMHFNlNugQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2041 [PATCH v2] Update commit message for more detail description When running with Python 3.x and relying on GenCfgOpt.py to automatically assign UPD offsets, the script crashed because some float type variable not compatible with the operations. Convert those float variable to int to fix these issues. Cc: Amy Chan Cc: Chasel Chiu Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Ching JenX Cheng Reviewed-by: Chasel Chiu --- 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') !=3D -1): Remainder =3D Offset % (MaxAlign/8) # MaxAli= gn 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 # Reset = to default 32 align when struct end @@ -727,7 +727,7 @@ EndList Remainder =3D Offset % max(ItemLength/8, 4, Si= zeAlign) Offset =3D Offset + ItemLength if Remainder: - Diff =3D max(ItemLength/8, 4, SizeAlign) -= Remainder + Diff =3D int(max(ItemLength/8, 4, SizeAlig= n) - Remainder) ItemOffset =3D ItemOffset + Diff ConfigDict['offset'] =3D ItemOffset =20 @@ -1416,7 +1416,7 @@ EndList if BitsRemain: BsfFd.write(" Skip %d bits\n" % BitsRem= ain) BitsGap -=3D BitsRemain - BytesRemain =3D BitsGap / 8 + BytesRemain =3D int(BitsGap / 8) if BytesRemain: BsfFd.write(" Skip %d bytes\n" % BytesR= emain) NextOffset =3D Item['offset'] + Item['length'] --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44792): https://edk2.groups.io/g/devel/message/44792 Mute This Topic: https://groups.io/mt/32677724/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-