From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 6B7DE941BEC for ; Wed, 6 Sep 2023 17:34:55 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=L7T1eMjZQPNhA0oUVdbQV9WnKKYvGXnlsvGGjAamEzI=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:From:To:Cc:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1694021694; v=1; b=kthqGQBDlax4kuJKIgnbYeGOwHpihLalq7P9gvU4MyrhyKjOUg0t0kCNPIfDQcCh+6Tv5mzb cuJzQRhMBMUOYIgc7ucpmNhULFRtJDZmOVWF4NvE4CWzzAj1MnMaF1/1uDXHgcbgd9HufM2rGVm wyQFxK2vyBWxXFtdeDfnAh5E= X-Received: by 127.0.0.2 with SMTP id sMkwYY7687511xID0BNa5GOR; Wed, 06 Sep 2023 10:34:54 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.5214.1694021693657837965 for ; Wed, 06 Sep 2023 10:34:53 -0700 X-Received: from localhost.localdomain (unknown [47.201.241.95]) by linux.microsoft.com (Postfix) with ESMTPSA id 8301B212B195; Wed, 6 Sep 2023 10:34:52 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8301B212B195 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Rebecca Cran Subject: [edk2-devel] [PATCH v1 1/1] MdePkg/Library/TdxLib: Remove unnecessary comparison Date: Wed, 6 Sep 2023 13:34:02 -0400 Message-ID: <20230906173402.1842-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mikuback@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3iyLaGUDJB46pCnL7UC5TFTUx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=kthqGQBD; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linux.microsoft.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: Michael Kubacki 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 --- 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 ( =20 ASSERT (Data !=3D NULL); ASSERT (DataLen =3D=3D SHA384_DIGEST_SIZE); - ASSERT (Index >=3D 0 && Index < RTMR_COUNT); + ASSERT (Index < RTMR_COUNT); =20 if ((Data =3D=3D NULL) || (DataLen !=3D SHA384_DIGEST_SIZE) || (Index = >=3D RTMR_COUNT)) { return EFI_INVALID_PARAMETER; --=20 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-