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.43; helo=mga05.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 4D50221BADAB9 for ; Thu, 10 Jan 2019 10:39:54 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2019 10:39:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,462,1539673200"; d="scan'208";a="117134392" Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.149]) by orsmga003.jf.intel.com with ESMTP; 10 Jan 2019 10:39:51 -0800 From: Jaben Carsey To: edk2-devel@lists.01.org Cc: Bob Feng , Liming Gao Date: Thu, 10 Jan 2019 10:39:49 -0800 Message-Id: <88d54115d53986c0354eee400453fff22f6690e0.1547145461.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [Patch v1 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, 10 Jan 2019 18:39:54 -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. 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..bc1d124bdddc 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 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