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=michael.d.kinney@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 6D38B21BADAB2 for ; Mon, 30 Jul 2018 19:32:49 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2018 19:32:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,425,1526367600"; d="scan'208";a="61115639" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga008.jf.intel.com with ESMTP; 30 Jul 2018 19:32:48 -0700 Received: from orsmsx114.amr.corp.intel.com (10.22.240.10) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 30 Jul 2018 19:32:48 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.96]) by ORSMSX114.amr.corp.intel.com ([169.254.8.242]) with mapi id 14.03.0319.002; Mon, 30 Jul 2018 19:32:48 -0700 From: "Kinney, Michael D" To: "Zeng, Star" , "edk2-devel@lists.01.org" , "Kinney, Michael D" Thread-Topic: [staging/FmpDevicePkg-master][PATCH] FmpDevicePkg FmpDxe: Use local variable to store test key digest size Thread-Index: AQHUKHYM9Ov733eCSka/4ZjZOAe0HKSonHzA Date: Tue, 31 Jul 2018 02:32:47 +0000 Message-ID: References: <1533004037-30880-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1533004037-30880-1-git-send-email-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Subject: Re: [staging/FmpDevicePkg-master][PATCH] FmpDevicePkg FmpDxe: Use local variable to store test key digest size X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2018 02:32:49 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael D Kinney Mike > -----Original Message----- > From: Zeng, Star > Sent: Monday, July 30, 2018 7:27 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Kinney, Michael D > > Subject: [staging/FmpDevicePkg-master][PATCH] > FmpDevicePkg FmpDxe: Use local variable to store test > key digest size >=20 > Some static tool reports "the condition in 'if' > statement is constant". >=20 > This patch updates the code to use local variable to > store test key > digest size. It can pass the static tool's check. >=20 > Cc: Michael D Kinney > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > FmpDevicePkg/FmpDxe/DetectTestKey.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/FmpDevicePkg/FmpDxe/DetectTestKey.c > b/FmpDevicePkg/FmpDxe/DetectTestKey.c > index 0a6e37ededae..dcf316262d21 100644 > --- a/FmpDevicePkg/FmpDxe/DetectTestKey.c > +++ b/FmpDevicePkg/FmpDxe/DetectTestKey.c > @@ -53,12 +53,14 @@ DetectTestKey ( > UINT8 *PublicKeyDataXdrEnd; > VOID *HashContext; > UINT8 Digest[SHA256_DIGEST_SIZE]; > + UINTN TestKeyDigestSize; >=20 > // > // If PcdFmpDeviceTestKeySha256Digest is not exacty > SHA256_DIGEST_SIZE bytes, > // then skip the test key detection. > // > - if (PcdGetSize (PcdFmpDeviceTestKeySha256Digest) !=3D > SHA256_DIGEST_SIZE) { > + TestKeyDigestSize =3D PcdGetSize > (PcdFmpDeviceTestKeySha256Digest); > + if (TestKeyDigestSize !=3D SHA256_DIGEST_SIZE) { > return; > } >=20 > -- > 2.7.0.windows.1