From nobody Thu May 2 09:33:22 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1504012175634976.8499634335437; Tue, 29 Aug 2017 06:09:35 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 604AE21E47D69; Tue, 29 Aug 2017 06:06:52 -0700 (PDT) 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 9459221E47D5E for ; Tue, 29 Aug 2017 06:06:51 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2017 06:09:28 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 29 Aug 2017 06:09:27 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,444,1498546800"; d="scan'208";a="145797853" From: Hao Wu To: edk2-devel@lists.01.org Date: Tue, 29 Aug 2017 21:09:26 +0800 Message-Id: <20170829130926.17396-1-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 Subject: [edk2] [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: , Cc: Hao Wu , Ruiyu Ni MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Ruiyu Ni --- .../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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel