Skip to content

Commit b0dda71

Browse files
v-jaschenapop5
authored andcommitted
MinPlatformPkg SerialPortTerminalLib: Fixing CodeQL issue Pointless c… (#311)
## Description Cherry-pick Commit 03664aa #282 from release/202311 to dev/202405. CodeQL is reporting Pointless comparison of unsigned value to zero for a value derived from an unsigned PCD PcdDefaultTerminalType. For details on how to complete these options and their meaning refer to [CONTRIBUTING.md](https://github.com/microsoft/mu/blob/HEAD/CONTRIBUTING.md). - [ ] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? - [X] Backport to release branch? ## How This Was Tested Ran Local CI including codeQL setting and pipeline codeQL build. ## Integration Instructions N/A ## upstream repo in EDK2? tianocore/edk2-platforms#246 Co-authored-by: Aaron <105021049+apop5@users.noreply.github.com> Co-authored-by: Aaron <aaronpop@microsoft.com>
1 parent 175663e commit b0dda71

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ AddSerialTerminal (
8888
(int) mSerialDevicePath.Uart.StopBits,
8989
(int) DefaultTerminalType));
9090

91-
if (DefaultTerminalType >= 0 &&
92-
DefaultTerminalType < (sizeof (mTerminalType) / sizeof (mTerminalType[0]))) {
91+
if (DefaultTerminalType < (sizeof (mTerminalType) / sizeof (mTerminalType[0]))) {
9392
CopyMem (
9493
(VOID *) &(mSerialDevicePath.TerminalType.Guid),
9594
(VOID *) mTerminalType[DefaultTerminalType],

0 commit comments

Comments
 (0)