From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5F31B211B81A0 for ; Thu, 17 Jan 2019 07:35:10 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2019 07:35:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,489,1539673200"; d="scan'208";a="128587092" Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.149]) by orsmga001.jf.intel.com with ESMTP; 17 Jan 2019 07:35:08 -0800 From: Jaben Carsey To: edk2-devel@lists.01.org Cc: Bob Feng , Liming Gao Date: Thu, 17 Jan 2019 07:35:07 -0800 Message-Id: X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [Patch V2 5/5] BaseTools/GenFds/Capsule: move function logic X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2019 15:35:10 -0000 Move PackRegistryFormatGuid logic from Common.Misc to this file. There were no other consumers of the function. As it is one line, just replace the logic without the separate function. v2 - change to fix the import statement Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/Common/Misc.py | 6 ------ BaseTools/Source/Python/GenFds/Capsule.py | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index 5968a3de4e1f..a1bfc502477c 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -1906,12 +1906,6 @@ class SkuClass(): else: return 'DEFAULT' -# -# Pack a registry format GUID -# -def PackRegistryFormatGuid(Guid): - return PackGUID(Guid.split('-')) - ## Get the integer value from string like "14U" or integer like 2 # # @param Input The object that may be either a integer value or a string diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/Python/GenFds/Capsule.py index df29c40dbd20..1cdbdcf7ba86 100644 --- a/BaseTools/Source/Python/GenFds/Capsule.py +++ b/BaseTools/Source/Python/GenFds/Capsule.py @@ -20,7 +20,7 @@ from .GenFdsGlobalVariable import GenFdsGlobalVariable, FindExtendTool from CommonDataClass.FdfClass import CapsuleClassObject import Common.LongFilePathOs as os from io import BytesIO -from Common.Misc import SaveFileOnChange, PackRegistryFormatGuid +from Common.Misc import SaveFileOnChange, PackGUID import uuid from struct import pack from Common import EdkLogger @@ -66,7 +66,7 @@ class Capsule (CapsuleClassObject): # # Use FMP capsule GUID: 6DCBD5ED-E82D-4C44-BDA1-7194199AD92A # - Header.write(PackRegistryFormatGuid('6DCBD5ED-E82D-4C44-BDA1-7194199AD92A')) + Header.write(PackGUID('6DCBD5ED-E82D-4C44-BDA1-7194199AD92A'.split('-'))) HdrSize = 0 if 'CAPSULE_HEADER_SIZE' in self.TokensDict: Header.write(pack('=I', int(self.TokensDict['CAPSULE_HEADER_SIZE'], 16))) -- 2.16.2.windows.1