From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.zytor.com (terminus.zytor.com [65.50.211.136]) (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 BD06F20945BFC for ; Tue, 12 Sep 2017 22:46:41 -0700 (PDT) Received: from [192.168.15.2] (189.27.227.204.dynamic.adsl.gvt.net.br [189.27.227.204]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id v8D5lL0V002992 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 12 Sep 2017 22:47:24 -0700 Date: Wed, 13 Sep 2017 02:47:14 -0300 User-Agent: K-9 Mail for Android In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103B940874@shsmsx102.ccr.corp.intel.com> References: <8c5a7ec1d6f908eabda755bb6d3bc9a28b14210e.1505277490.git.pcacjr@zytor.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B940874@shsmsx102.ccr.corp.intel.com> MIME-Version: 1.0 To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Ni, Ruiyu" , "Bi, Dandan" From: Paulo Alcantara Message-ID: <37D67821-E356-4E48-B175-3107DEF070AC@zytor.com> Subject: Re: [PATCH] MdeModulePkg/UdfDxe: Remove negative comparison of unsigned number 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: , X-List-Received-Date: Wed, 13 Sep 2017 05:46:41 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On September 13, 2017 2:08:54 AM GMT-03:00, "Zeng, Star" wrote: >I do not understand the context of the code=2E >The change is good to fix the build failure, but I want to ask a >question before I gave Rb=2E :) > >Is it possible ReadFileInfo->FilePosition less than FilePosition? Nope=2E When doing my tests, I briefly looked at code how it's used and al= so added an ASSERT() to make sure it is never lesser than FilePosition=2E BTW, I *do* know that the code really needs refactoring, documentation, et= c=2E -- I didnt do that before because I believed that it would never get = upstream -- since its now -- I will look forward to that in my free time=2E Its 2:46am here so I should get some sleep :-) Thanks! Paulo > > >Thanks, >Star >-----Original Message----- >From: Paulo Alcantara [mailto:pcacjr@zytor=2Ecom]=20 >Sent: Wednesday, September 13, 2017 12:45 PM >To: edk2-devel@lists=2E01=2Eorg >Cc: Paulo Alcantara ; Zeng, Star >; Dong, Eric ; Ni, Ruiy= u >; Bi, Dandan >Subject: [PATCH] MdeModulePkg/UdfDxe: Remove negative comparison of >unsigned number > >This patch gets rid of a negative comparison of an UINT64 type (Offset) >as it'll never evaluate to true=2E > >Cc: Star Zeng >Cc: Eric Dong >Cc: Ruiyu Ni >Cc: Dandan Bi >Contributed-under: TianoCore Contribution Agreement 1=2E1 >Reported-by: Star Zeng >Signed-off-by: Paulo Alcantara >--- > MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations=2Ec | 3 --- > 1 file changed, 3 deletions(-) > >diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations=2Ec >b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations=2Ec >index 7286265373=2E=2E2039f80289 100644 >--- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations=2Ec >+++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations=2Ec >@@ -1082,9 +1082,6 @@ ReadFile ( >=20 > if (FilePosition + ExtentLength > ReadFileInfo->FilePosition) { > Offset =3D ReadFileInfo->FilePosition - FilePosition; >- if (Offset < 0) { >- Offset =3D -(Offset); >- } > } else { > Offset =3D 0; > } >-- >2=2E11=2E0 --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E