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.93; helo=mga11.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 321A2210C5140 for ; Sun, 29 Jul 2018 22:43:06 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2018 22:43:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,421,1526367600"; d="scan'208";a="77075164" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by orsmga001.jf.intel.com with ESMTP; 29 Jul 2018 22:43:05 -0700 Received: from orsmsx112.amr.corp.intel.com (10.22.240.13) by ORSMSX110.amr.corp.intel.com (10.22.240.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 29 Jul 2018 22:43:05 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.96]) by ORSMSX112.amr.corp.intel.com ([169.254.3.12]) with mapi id 14.03.0319.002; Sun, 29 Jul 2018 22:43:04 -0700 From: "Kinney, Michael D" To: "Zeng, Star" , "edk2-devel@lists.01.org" , "Kinney, Michael D" Thread-Topic: [staging/FmpDevicePkg-master][PATCH] FmpDevicePkg FmpDxe: Initialize DeviceLibLowestSupportedVersion Thread-Index: AdQnsCsnYV/9vOC7Qlig0sI6pj2OHwAFtk2QAAAlfWAAACGEAA== Date: Mon, 30 Jul 2018 05:43:03 +0000 Message-ID: References: <0C09AFA07DD0434D9E2A0C6AEB0483103BB8A0E9@shsmsx102.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BB8A1DA@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BB8A1DA@shsmsx102.ccr.corp.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: 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:43:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable That proposal looks better. Mike > -----Original Message----- > From: Zeng, Star > Sent: Sunday, July 29, 2018 10:42 PM > To: Kinney, Michael D ; > edk2-devel@lists.01.org > Cc: Zeng, Star > Subject: RE: [staging/FmpDevicePkg-master][PATCH] > FmpDevicePkg FmpDxe: Initialize > DeviceLibLowestSupportedVersion >=20 > Normally, FmpDeviceGetLowestSupportedVersion() should > not touch input DeviceLibLowestSupportedVersion when > returning an error. > If we think it is legal that > DeviceLibLowestSupportedVersion could be updated in an > error case by FmpDeviceGetLowestSupportedVersion(), > then we could only add new line below before calling > FmpDeviceGetLowestSupportedVersion(). >=20 > DeviceLibLowestSupportedVersion =3D > DEFAULT_LOWESTSUPPORTEDVERSION; >=20 >=20 > Thanks, > Star >=20 > -----Original Message----- > From: Kinney, Michael D > Sent: Monday, July 30, 2018 1:36 PM > To: Zeng, Star ; edk2- > devel@lists.01.org; Kinney, Michael D > > Subject: RE: [staging/FmpDevicePkg-master][PATCH] > FmpDevicePkg FmpDxe: Initialize > DeviceLibLowestSupportedVersion >=20 > Star, >=20 > I do not think the logic is identical. >=20 > The function FmpDeviceGetLowestSupportedVersion() could > modify the value of DeviceLibLowestSupportedVersion and > return an error. >=20 > Mike >=20 > > -----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 > > > > Subject: [staging/FmpDevicePkg-master][PATCH] > > FmpDevicePkg FmpDxe: Initialize > > DeviceLibLowestSupportedVersion > > > > Update the title to include "[staging/FmpDevicePkg- > master]". > > > > 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 > > > > Subject: [PATCH] FmpDevicePkg FmpDxe: Initialize > > DeviceLibLowestSupportedVersion > > > > Some static tool reports > > "DeviceLibLowestSupportedVersion" is used, but is > uninitialized. It is > > false positive reporting based because > DeviceLibLowestSupportedVersion > > will have assigned value after > > FmpDeviceGetLowestSupportedVersion() returns SUCCESS. > > > > This patch refines the code to initialize > > DeviceLibLowestSupportedVersion to > DEFAULT_LOWESTSUPPORTEDVERSION > > before calling FmpDeviceGetLowestSupportedVersion(). > > It can pass the static tool's check. > > > > 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(-) > > > > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c > > 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); > > > > if (DeviceLibLowestSupportedVersion > ReturnLsv) { > > ReturnLsv =3D DeviceLibLowestSupportedVersion; > > -- > > 2.7.0.windows.1