From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 A3EE621E47D64 for ; Tue, 29 Aug 2017 06:19:23 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2017 06:22:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,444,1498546800"; d="scan'208";a="143225858" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 29 Aug 2017 06:22:03 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 29 Aug 2017 06:22:03 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 29 Aug 2017 06:22:03 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.117]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Tue, 29 Aug 2017 21:22:01 +0800 From: "Ni, Ruiyu" To: "Wu, Hao A" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] SourceLevelDebugPkg/DebugAgentCommon: Use global variable for revision Thread-Index: AQHTIMgMxOz9gHTpREOVxqZaj5Ln96KbUfvw Date: Tue, 29 Aug 2017 13:22:00 +0000 Deferred-Delivery: Tue, 29 Aug 2017 13:22:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BA160EC@SHSMSX104.ccr.corp.intel.com> References: <20170829130926.17396-1-hao.a.wu@intel.com> In-Reply-To: <20170829130926.17396-1-hao.a.wu@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] SourceLevelDebugPkg/DebugAgentCommon: Use global variable for revision 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: Tue, 29 Aug 2017 13:19:23 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni -----Original Message----- From: Wu, Hao A=20 Sent: Tuesday, August 29, 2017 9:09 PM To: edk2-devel@lists.01.org Cc: Wu, Hao A ; Ni, Ruiyu Subject: [PATCH] SourceLevelDebugPkg/DebugAgentCommon: Use global variable = for revision Since some static code checkers complain that comparing two macros will generate a constant result, this commit uses a global variable to reflect the revision information of the debug agent, rather than using a macro directly. Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu --- .../Library/DebugAgent/DebugAgentCommon/DebugAgent.c | 7 +++= +--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugA= gent.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent= .c index f156fe24db..93af009f96 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c +++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c @@ -130,7 +130,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_VECTOR_HANDOFF_INFO m= VectorHandoffInfoDebugAge } }; =20 -GLOBAL_REMOVE_IF_UNREFERENCED UINTN mVectorHandoffInfoCount =3D sizeof (mV= ectorHandoffInfoDebugAgent) / sizeof (EFI_VECTOR_HANDOFF_INFO); +GLOBAL_REMOVE_IF_UNREFERENCED UINTN mVectorHandoffInfoCount =3D sizeof (m= VectorHandoffInfoDebugAgent) / sizeof (EFI_VECTOR_HANDOFF_INFO); +GLOBAL_REMOVE_IF_UNREFERENCED UINT32 mDebugAgentRevision =3D DEBUG_AGE= NT_REVISION; =20 /** Calculate CRC16 for target data. @@ -1564,7 +1565,7 @@ ReadMemoryAndSendResponsePacket ( // Compression/decompression support was added since revision 0.4. // Revision 0.3 shouldn't compress the packet. // - if (DEBUG_AGENT_REVISION >=3D DEBUG_AGENT_REVISION_04) { + if (mDebugAgentRevision >=3D DEBUG_AGENT_REVISION_04) { // // Get the compressed data size without modifying the packet. // @@ -2192,7 +2193,7 @@ CommandCommunication ( break; =20 case DEBUG_COMMAND_GET_REVISION: - DebugAgentRevision.Revision =3D DEBUG_AGENT_REVISION; + DebugAgentRevision.Revision =3D mDebugAgentRevision; DebugAgentRevision.Capabilities =3D DEBUG_AGENT_CAPABILITIES; Status =3D SendDataResponsePacket ((UINT8 *) &DebugAgentRevision, (U= INT16) sizeof (DEBUG_DATA_RESPONSE_GET_REVISION), DebugHeader); break; --=20 2.12.0.windows.1