Reviewed-by: Jiewen Yao <[email protected]>

> -----Original Message-----
> From: [email protected] <[email protected]> On Behalf Of Michael
> Kubacki
> Sent: Thursday, September 7, 2023 1:34 AM
> To: [email protected]
> Cc: Kinney, Michael D <[email protected]>; Gao, Liming
> <[email protected]>; Liu, Zhiguang <[email protected]>; Rebecca
> Cran <[email protected]>
> Subject: [edk2-devel] [PATCH v1 1/1] MdePkg/Library/TdxLib: Remove
> unnecessary comparison
> 
> From: Michael Kubacki <[email protected]>
> 
> 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 <[email protected]>
> Cc: Liming Gao <[email protected]>
> Cc: Zhiguang Liu <[email protected]>
> Cc: Rebecca Cran <[email protected]>
> Signed-off-by: Michael Kubacki <[email protected]>
> ---
>  MdePkg/Library/TdxLib/Rtmr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/TdxLib/Rtmr.c b/MdePkg/Library/TdxLib/Rtmr.c
> index a0283966b353..cbf1dda7bcff 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;
> --
> 2.42.0.windows.2
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#108335): https://edk2.groups.io/g/devel/message/108335
> Mute This Topic: https://groups.io/mt/101198214/1772286
> Group Owner: [email protected]
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108346): https://edk2.groups.io/g/devel/message/108346
Mute This Topic: https://groups.io/mt/101198214/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to