From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "mikuback@linux.microsoft.com" <mikuback@linux.microsoft.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Gao, Liming" <gaoliming@byosoft.com.cn>,
"Liu, Zhiguang" <zhiguang.liu@intel.com>,
Rebecca Cran <rebecca@bsdio.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] MdePkg/Library/TdxLib: Remove unnecessary comparison
Date: Thu, 7 Sep 2023 22:01:15 +0000 [thread overview]
Message-ID: <CO1PR11MB4929713F5FD044C106A8F05ED2EEA@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230906173402.1842-1-mikuback@linux.microsoft.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> -----Original Message-----
> From: mikuback@linux.microsoft.com <mikuback@linux.microsoft.com>
> Sent: Wednesday, September 6, 2023 10:34 AM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>;
> Rebecca Cran <rebecca@bsdio.com>
> Subject: [PATCH v1 1/1] MdePkg/Library/TdxLib: Remove unnecessary
> comparison
>
> From: Michael Kubacki <michael.kubacki@microsoft.com>
>
> 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 <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> ---
> 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 (#108423): https://edk2.groups.io/g/devel/message/108423
Mute This Topic: https://groups.io/mt/101198214/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
prev parent reply other threads:[~2023-09-07 22:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-06 17:34 [edk2-devel] [PATCH v1 1/1] MdePkg/Library/TdxLib: Remove unnecessary comparison Michael Kubacki
2023-09-06 23:32 ` Yao, Jiewen
2023-09-08 0:38 ` 回复: " gaoliming via groups.io
2023-09-07 22:01 ` Michael D Kinney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CO1PR11MB4929713F5FD044C106A8F05ED2EEA@CO1PR11MB4929.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox