From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 EC8E821E87980 for ; Tue, 12 Sep 2017 22:06:00 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2017 22:08:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,386,1500966000"; d="scan'208";a="151231201" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 12 Sep 2017 22:08:58 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 22:08:57 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Sep 2017 22:08:57 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.39]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.168]) with mapi id 14.03.0319.002; Wed, 13 Sep 2017 13:08:55 +0800 From: "Zeng, Star" To: Paulo Alcantara , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Ni, Ruiyu" , "Bi, Dandan" , "Zeng, Star" Thread-Topic: [PATCH] MdeModulePkg/UdfDxe: Remove negative comparison of unsigned number Thread-Index: AQHTLEsk9oaBZ5JdJkSAcz7I8VLM2KKyQ1ew Date: Wed, 13 Sep 2017 05:08:54 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B940874@shsmsx102.ccr.corp.intel.com> References: <8c5a7ec1d6f908eabda755bb6d3bc9a28b14210e.1505277490.git.pcacjr@zytor.com> In-Reply-To: <8c5a7ec1d6f908eabda755bb6d3bc9a28b14210e.1505277490.git.pcacjr@zytor.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] 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:06:01 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I do not understand the context of the code. The change is good to fix the build failure, but I want to ask a question b= efore I gave Rb. :) Is it possible ReadFileInfo->FilePosition less than FilePosition? Thanks, Star -----Original Message----- From: Paulo Alcantara [mailto:pcacjr@zytor.com]=20 Sent: Wednesday, September 13, 2017 12:45 PM To: edk2-devel@lists.01.org Cc: Paulo Alcantara ; Zeng, Star ; D= ong, Eric ; Ni, Ruiyu ; Bi, Dandan= Subject: [PATCH] MdeModulePkg/UdfDxe: Remove negative comparison of unsigne= d number This patch gets rid of a negative comparison of an UINT64 type (Offset) as = it'll never evaluate to true. Cc: Star Zeng Cc: Eric Dong Cc: Ruiyu Ni Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Reported-by: Star Zeng Signed-off-by: Paulo Alcantara --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 7286265373..2039f80289 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -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.11.0