From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 A1D7A21A04820 for ; Fri, 31 Mar 2017 22:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491025417; x=1522561417; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=w+brR7YYkYk5umhHpQ/HnBHVLAKHGWovjHw6v87QL3k=; b=ATcdJ/WhQZlhQgjOiIpJFeDI+SapoCdflHO8AckE5LVw+CiI9YitSFWG yUtMt0zVaTI5UvQuM4mHmsz1zEOw5Q==; Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Mar 2017 22:43:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,255,1486454400"; d="scan'208";a="242722747" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 31 Mar 2017 22:43:36 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 31 Mar 2017 22:43:33 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 31 Mar 2017 22:43:32 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.212]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.42]) with mapi id 14.03.0248.002; Sat, 1 Apr 2017 13:43:31 +0800 From: "Zhang, Lubo" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Bi, Dandan" , "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [Patch] MdeModulePkg/DxeHttpLib: Avoid the pointless comparison of UINTN with zero Thread-Index: AQHSqn4BKtj2ffNwLk+SR8yT8MFz1aGwALZQ Date: Sat, 1 Apr 2017 05:43:30 +0000 Message-ID: <7619447B08B8F74DA4FF2A813B79803B39B14C0C@shsmsx102.ccr.corp.intel.com> References: <1491006122-5416-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1491006122-5416-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: 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/DxeHttpLib: Avoid the pointless comparison of UINTN with zero 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: Sat, 01 Apr 2017 05:43:37 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Zhang Lubo -----Original Message----- From: Wu, Jiaxin=20 Sent: Saturday, April 01, 2017 8:22 AM To: edk2-devel@lists.01.org Cc: Bi, Dandan ; Zhang, Lubo ; Y= e, Ting ; Fu, Siyuan ; Wu, Jiaxin <= jiaxin.wu@intel.com> Subject: [Patch] MdeModulePkg/DxeHttpLib: Avoid the pointless comparison of= UINTN with zero UINTN is unsigned integer, so it's pointless to compare it with zero. Cc: Bi Dandan Cc: Zhang Lubo Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 2 +- MdeModulePkg/Library/= DxeHttpLib/DxeHttpLib.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Li= brary/DxeHttpLib/DxeHttpLib.c index 8e29213..8421caa 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -734,11 +734,11 @@ HttpUrlGetPort ( Index ++; } =20 Status =3D AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FI= ELD_PORT].Offset, (CHAR8 **) NULL, &Data); =20 - if (Data > HTTP_URI_PORT_MAX_NUM || Data < HTTP_URI_PORT_MIN_NUM) { + if (Data > HTTP_URI_PORT_MAX_NUM) { return EFI_INVALID_PARAMETER; } =20 *Port =3D (UINT16) Data; return Status; diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h b/MdeModulePkg/Li= brary/DxeHttpLib/DxeHttpLib.h index 5ee0fdc..af82c16 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h @@ -48,11 +48,10 @@ Header file for HttpLib. #define HTTP_URI_FIELD_USERINFO 5 #define HTTP_URI_FIELD_HOST 6 #define HTTP_URI_FIELD_PORT 7 #define HTTP_URI_FIELD_MAX 8 =20 -#define HTTP_URI_PORT_MIN_NUM 0 #define HTTP_URI_PORT_MAX_NUM 65535 =20 // // Structure to store the parse result of a HTTP URL. // -- 1.9.5.msysgit.1