From 92f0dab22e3153befc96b9d8fd05281afe3a6dad Mon Sep 17 00:00:00 2001 From: jasonc4 Date: Thu, 7 Nov 2024 10:44:37 +0800 Subject: [PATCH] Fix the CodeQL issue - reference release/202311, MinPlatformPkg SerialPortTerminalLib: Fixing CodeQL issue Pointless comparison of unsigned value to zero. #282 --- .../Library/SerialPortTerminalLib/SerialPortTerminalLib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c b/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c index eb127d8315..7d50e3168f 100644 --- a/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c +++ b/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c @@ -88,8 +88,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],