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=hao.a.wu@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 76D18211799CC for ; Tue, 16 Oct 2018 00:55:34 -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 fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2018 00:55:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,387,1534834800"; d="scan'208";a="272783770" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 16 Oct 2018 00:55:33 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 16 Oct 2018 00:55:33 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 16 Oct 2018 00:55:33 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.48]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.245]) with mapi id 14.03.0319.002; Tue, 16 Oct 2018 15:55:30 +0800 From: "Wu, Hao A" To: "Zeng, Star" , Leif Lindholm CC: "Ni, Ruiyu" , "edk2-devel@lists.01.org" , "Zeng, Star" Thread-Topic: [edk2] [PATCH v1 6/7] MdeModulePkg/UdfDxe: Remove dead codes in FileName.c Thread-Index: AQHUZENYkxnur+eDu0SIBHQDpQiCvaUg4e8AgACIJSD//4/dAIAAiJ8Q Date: Tue, 16 Oct 2018 07:55:29 +0000 Message-ID: References: <20181015045522.18732-1-hao.a.wu@intel.com> <20181015045522.18732-7-hao.a.wu@intel.com> <20181016062008.tubfnsw3p6nbkew6@bivouac.eciton.net> <9ff35864-15d9-aa86-f855-4d3dff83b700@intel.com> In-Reply-To: <9ff35864-15d9-aa86-f855-4d3dff83b700@intel.com> 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: [PATCH v1 6/7] MdeModulePkg/UdfDxe: Remove dead codes in FileName.c X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 07:55:34 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Zeng, Star > Sent: Tuesday, October 16, 2018 3:46 PM > To: Wu, Hao A; Leif Lindholm > Cc: Ni, Ruiyu; edk2-devel@lists.01.org; Zeng, Star > Subject: Re: [edk2] [PATCH v1 6/7] MdeModulePkg/UdfDxe: Remove dead > codes in FileName.c >=20 > Hao, >=20 > If these code removing will make the function to be not matched with its > original implementation purpose according to the function description, > and the description is not updated, the code's readability will be > sacrificed. I prefer to keep the code's readability and follow the > function's original implementation purpose. >=20 OK, I will drop this patch in the next series. Best Regards, Hao Wu >=20 > Thanks, > Star >=20 > On 2018/10/16 14:28, Wu, Hao A wrote: > >> -----Original Message----- > >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > >> Leif Lindholm > >> Sent: Tuesday, October 16, 2018 2:20 PM > >> To: Wu, Hao A > >> Cc: Ni, Ruiyu; edk2-devel@lists.01.org; Zeng, Star > >> Subject: Re: [edk2] [PATCH v1 6/7] MdeModulePkg/UdfDxe: Remove > dead > >> codes in FileName.c > >> > >> On Mon, Oct 15, 2018 at 12:55:21PM +0800, Hao Wu wrote: > >>> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1249 > >>> > >>> We found potential dead codes within File.c during the code coverage > test. > >>> > >>> After manual review, we think the below ones are positive reports: > >>> > >>> A. In function MangleFileName(): > >>> > >>> FileName =3D TrimString (FileName); > >>> // Begin of dead codes > >>> if (*FileName =3D=3D L'\0') { > >>> goto Exit; > >>> } > >>> // End of dead codes > >>> > >>> When the code reaches the TrimString() call, the string in 'FileName'= is > >>> guaranteed to have a '\' character due to the call patterns of > >> > >> What in the call pattern guarantees this? Please be precise. > > > > OK, I will update the log message. > > > >> > >>> MangleFileName(). So after trimming the lead-off/tailing white spaces= , > >>> string in 'FileName' will not be an empty string. > >>> > >>> B. In function MangleFileName(): > >>> > >>> if (FileName[0] =3D=3D L'.') { > >>> if (FileName[1] =3D=3D L'.') { > >>> if (FileName[2] =3D=3D L'\0') { > >>> goto Exit; > >>> } else { > >>> FileName +=3D 2; > >>> } > >>> } else if (FileName[1] =3D=3D L'\0') { > >>> goto Exit; > >>> } > >>> } > >>> > >>> When the code hits the above checks, string in 'FileName' will always > have > >>> a leading '\' character (denoting an absolute path) due to the call > >>> patterns of MangleFileName(). So no leading '.' can be there in strin= g > >>> 'FileName'. > >> > >> What in the call pattern guarantees this? Please be precise. > > > > OK, I will update the log message. > > > > Thanks for the comments. > > > > Best Regards, > > Hao Wu > > > >> > >> Regards, > >> > >> Leif > >> _______________________________________________ > >> edk2-devel mailing list > >> edk2-devel@lists.01.org > >> https://lists.01.org/mailman/listinfo/edk2-devel >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel