From e2d662c3135a5d420d6050f42e969e78f6bb19f1 Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Sat, 1 Apr 2017 08:21:03 +0800 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 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/Library/DxeHttpLib/DxeHttpLib.c index 8e29213a4f..8421caaa70 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -736,7 +736,7 @@ HttpUrlGetPort ( Status = AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data); - if (Data > HTTP_URI_PORT_MAX_NUM || Data < HTTP_URI_PORT_MIN_NUM) { + if (Data > HTTP_URI_PORT_MAX_NUM) { return EFI_INVALID_PARAMETER; } diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h index 5ee0fdc619..af82c16fc3 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h @@ -50,7 +50,6 @@ Header file for HttpLib. #define HTTP_URI_FIELD_PORT 7 #define HTTP_URI_FIELD_MAX 8 -#define HTTP_URI_PORT_MIN_NUM 0 #define HTTP_URI_PORT_MAX_NUM 65535 // -- 2.39.2