]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/DxeHttpLib: Avoid the pointless comparison of UINTN with zero
authorJiaxin Wu <jiaxin.wu@intel.com>
Sat, 1 Apr 2017 00:21:03 +0000 (08:21 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Sat, 1 Apr 2017 06:52:12 +0000 (14:52 +0800)
UINTN is unsigned integer, so it's pointless to compare it with zero.

Cc: Bi Dandan <dandan.bi@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h

index 8e29213a4f2e5813f7eccae04d6087724b8f82b6..8421caaa703c2cf3af8f5cf4dbae088e23ce0d38 100644 (file)
@@ -736,7 +736,7 @@ HttpUrlGetPort (
 \r
   Status =  AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data);\r
 \r
-  if (Data > HTTP_URI_PORT_MAX_NUM || Data < HTTP_URI_PORT_MIN_NUM) {\r
+  if (Data > HTTP_URI_PORT_MAX_NUM) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 5ee0fdc61985086bbcf7dfc6adcbfa2eb1f0c68d..af82c16fc3d86d447d56fc43b18f377fd9ad0f6e 100644 (file)
@@ -50,7 +50,6 @@ Header file for HttpLib.
 #define   HTTP_URI_FIELD_PORT             7\r
 #define   HTTP_URI_FIELD_MAX              8\r
 \r
-#define   HTTP_URI_PORT_MIN_NUM           0\r
 #define   HTTP_URI_PORT_MAX_NUM           65535\r
 \r
 //\r