From nobody Fri May 3 22:18:48 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1491006128866685.9587020788745; Fri, 31 Mar 2017 17:22:08 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C6B5F21A04820; Fri, 31 Mar 2017 17:22:05 -0700 (PDT) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 5BD9F21A04804 for ; Fri, 31 Mar 2017 17:22:04 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Mar 2017 17:22:05 -0700 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.41]) by orsmga004.jf.intel.com with ESMTP; 31 Mar 2017 17:22:03 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491006125; x=1522542125; h=from:to:cc:subject:date:message-id; bh=nf+YUq0V3ywAQ79SrOycAwo95VwtRPYtgabJcnYpFKU=; b=KIBFishkQiks8fSJ3Hw6YcRbYKLGbEu3rOpz7eriwfZCTEfa5F9By6h/ Lalz6L6/+GvSjgCUnu+iPoHyUfZE6w==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,254,1486454400"; d="scan'208";a="72400917" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Sat, 1 Apr 2017 08:22:02 +0800 Message-Id: <1491006122-5416-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [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: , Cc: Ye Ting , Bi Dandan , Fu Siyuan , Wu Jiaxin , Zhang Lubo MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Zhang Lubo --- 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. // --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel