From 60d0f5802bceab3482c6be6dfde73a2af8373f9f Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Wed, 6 Sep 2023 10:35:11 -0400 Subject: MdePkg/Library/TdxLib: Remove unnecessary comparison Removes the comparison since unsigned values are always greater than or equal to 0. See the following CodeQL query for more info: /cpp/cpp-unsigned-comparison-zero/ Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Rebecca Cran Signed-off-by: Michael Kubacki Reviewed-by: Liming Gao Reviewed-by: Michael D Kinney Reviewed-by: Jiewen Yao --- MdePkg/Library/TdxLib/Rtmr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MdePkg') diff --git a/MdePkg/Library/TdxLib/Rtmr.c b/MdePkg/Library/TdxLib/Rtmr.c index a0283966b3..cbf1dda7bc 100644 --- a/MdePkg/Library/TdxLib/Rtmr.c +++ b/MdePkg/Library/TdxLib/Rtmr.c @@ -51,7 +51,7 @@ TdExtendRtmr ( ASSERT (Data != NULL); ASSERT (DataLen == SHA384_DIGEST_SIZE); - ASSERT (Index >= 0 && Index < RTMR_COUNT); + ASSERT (Index < RTMR_COUNT); if ((Data == NULL) || (DataLen != SHA384_DIGEST_SIZE) || (Index >= RTMR_COUNT)) { return EFI_INVALID_PARAMETER; -- cgit v1.2.3