From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 EDAFE21E49BCC for ; Tue, 22 Aug 2017 19:28:43 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 22 Aug 2017 19:31:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,415,1498546800"; d="scan'208";a="1165258533" Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.51]) by orsmga001.jf.intel.com with ESMTP; 22 Aug 2017 19:31:16 -0700 From: Eric Dong To: edk2-devel@lists.01.org Cc: Michael Kinney , Ruiyu Ni Date: Wed, 23 Aug 2017 10:31:12 +0800 Message-Id: <1503455473-14360-2-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1503455473-14360-1-git-send-email-eric.dong@intel.com> References: <1503455473-14360-1-git-send-email-eric.dong@intel.com> Subject: [Patch 1/2] UefiCpuPkg/CpuCommonFeaturesLib: Remove redundant definition. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Aug 2017 02:28:44 -0000 The EnumProcTraceMemDisable/OutputSchemeInvalid are redundant definitions. These definitions can be handled by other code, so remove them. Cc: Michael Kinney Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c index a90dd4e..6524882 100644 --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c @@ -35,8 +35,7 @@ typedef enum { Enum16M, Enum32M, Enum64M, - Enum128M, - EnumProcTraceMemDisable + Enum128M } PROC_TRACE_MEM_SIZE; /// @@ -44,8 +43,7 @@ typedef enum { /// typedef enum { OutputSchemeSingleRange = 0, - OutputSchemeToPA, - OutputSchemeInvalid + OutputSchemeToPA } PROC_TRACE_OUTPUT_SCHEME; typedef struct { @@ -134,10 +132,6 @@ ProcTraceSupport ( // Check if ProcTraceMemorySize option is enabled (0xFF means disable by user) // ProcTraceData = (PROC_TRACE_DATA *) ConfigData; - if ((ProcTraceData->ProcTraceMemSize >= EnumProcTraceMemDisable) || - (ProcTraceData->ProcTraceOutputScheme >= OutputSchemeInvalid)) { - return FALSE; - } // // Check if Processor Trace is supported @@ -151,8 +145,8 @@ ProcTraceSupport ( AsmCpuidEx (CPUID_INTEL_PROCESSOR_TRACE, CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF, NULL, NULL, &Ecx.Uint32, NULL); ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported = (BOOLEAN) (Ecx.Bits.RTIT == 1); ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported = (BOOLEAN) (Ecx.Bits.SingleRangeOutput == 1); - if (ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported || - ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported) { + if ((ProcTraceData->ProcessorData[ProcessorNumber].TopaSupported && (ProcTraceData->ProcTraceOutputScheme == OutputSchemeToPA)) || + (ProcTraceData->ProcessorData[ProcessorNumber].SingleRangeSupported && (ProcTraceData->ProcTraceOutputScheme == OutputSchemeSingleRange))) { return TRUE; } -- 2.7.0.windows.1