From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 BB994210C5131 for ; Sun, 29 Jul 2018 22:42:15 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2018 22:42:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,421,1526367600"; d="scan'208";a="250069305" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 29 Jul 2018 22:41:44 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 29 Jul 2018 22:41:44 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.81]) with mapi id 14.03.0319.002; Mon, 30 Jul 2018 13:41:42 +0800 From: "Zeng, Star" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [staging/FmpDevicePkg-master][PATCH] FmpDevicePkg FmpDxe: Initialize DeviceLibLowestSupportedVersion Thread-Index: AdQnsCsnYV/9vOC7Qlig0sI6pj2OHwAFtk2QAAAlfWA= Date: Mon, 30 Jul 2018 05:41:42 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB8A1DA@shsmsx102.ccr.corp.intel.com> References: <0C09AFA07DD0434D9E2A0C6AEB0483103BB8A0E9@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [staging/FmpDevicePkg-master][PATCH] FmpDevicePkg FmpDxe: Initialize DeviceLibLowestSupportedVersion 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: Mon, 30 Jul 2018 05:42:16 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Normally, FmpDeviceGetLowestSupportedVersion() should not touch input Devic= eLibLowestSupportedVersion when returning an error. If we think it is legal that DeviceLibLowestSupportedVersion could be updat= ed in an error case by FmpDeviceGetLowestSupportedVersion(), then we could = only add new line below before calling FmpDeviceGetLowestSupportedVersion()= . DeviceLibLowestSupportedVersion =3D DEFAULT_LOWESTSUPPORTEDVERSION; Thanks, Star -----Original Message----- From: Kinney, Michael D=20 Sent: Monday, July 30, 2018 1:36 PM To: Zeng, Star ; edk2-devel@lists.01.org; Kinney, Mich= ael D Subject: RE: [staging/FmpDevicePkg-master][PATCH] FmpDevicePkg FmpDxe: Init= ialize DeviceLibLowestSupportedVersion Star, I do not think the logic is identical. The function FmpDeviceGetLowestSupportedVersion() could modify the value of= DeviceLibLowestSupportedVersion and return an error. Mike > -----Original Message----- > From: Zeng, Star > Sent: Sunday, July 29, 2018 7:51 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D ; Zeng, Star=20 > > Subject: [staging/FmpDevicePkg-master][PATCH] > FmpDevicePkg FmpDxe: Initialize > DeviceLibLowestSupportedVersion >=20 > Update the title to include "[staging/FmpDevicePkg- master]". >=20 > Thanks, > Star > -----Original Message----- > From: Zeng, Star > Sent: Monday, July 30, 2018 10:50 AM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Kinney, Michael D=20 > > Subject: [PATCH] FmpDevicePkg FmpDxe: Initialize=20 > DeviceLibLowestSupportedVersion >=20 > Some static tool reports > "DeviceLibLowestSupportedVersion" is used, but is uninitialized. It is=20 > false positive reporting based because DeviceLibLowestSupportedVersion=20 > will have assigned value after > FmpDeviceGetLowestSupportedVersion() returns SUCCESS. >=20 > This patch refines the code to initialize=20 > DeviceLibLowestSupportedVersion to DEFAULT_LOWESTSUPPORTEDVERSION=20 > before calling FmpDeviceGetLowestSupportedVersion(). > 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/FmpDxe.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c=20 > b/FmpDevicePkg/FmpDxe/FmpDxe.c index > b25a1511c70c..4868f80de2b9 100644 > --- a/FmpDevicePkg/FmpDxe/FmpDxe.c > +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c > @@ -229,10 +229,8 @@ GetLowestSupportedVersion ( > // > // Check the FmpDeviceLib > // > - Status =3D FmpDeviceGetLowestSupportedVersion > (&DeviceLibLowestSupportedVersion); > - if (EFI_ERROR (Status)) { > - DeviceLibLowestSupportedVersion =3D > DEFAULT_LOWESTSUPPORTEDVERSION; > - } > + DeviceLibLowestSupportedVersion =3D > DEFAULT_LOWESTSUPPORTEDVERSION; > + FmpDeviceGetLowestSupportedVersion > (&DeviceLibLowestSupportedVersion); >=20 > if (DeviceLibLowestSupportedVersion > ReturnLsv) { > ReturnLsv =3D DeviceLibLowestSupportedVersion; > -- > 2.7.0.windows.1