From 9a1d2ad71c7e4843795ac832738a7bb588634350 Mon Sep 17 00:00:00 2001 From: jasonc4 Date: Thu, 14 Nov 2024 01:36:24 +0800 Subject: [PATCH] CodeQL is reporting Pointless comparison of unsigned value to zero. Signed-off-by: jasonc4 Cc: Reviewer Aaron Pop Cc: Reviewer Shruti Gupta --- .../Library/SerialPortTerminalLib/SerialPortTerminalLib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c index ca5e966cb52..befa54d6c65 100644 --- a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c +++ b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c @@ -89,8 +89,7 @@ AddSerialTerminal ( (int) mSerialDevicePath.Uart.StopBits, (int) DefaultTerminalType)); - if (DefaultTerminalType >= 0 && - DefaultTerminalType < (sizeof (mTerminalType) / sizeof (mTerminalType[0]))) { + if (DefaultTerminalType < (sizeof (mTerminalType) / sizeof (mTerminalType[0]))) { CopyMem ( (VOID *) &(mSerialDevicePath.TerminalType.Guid), (VOID *) mTerminalType[DefaultTerminalType],