From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.groups.io (mail04.groups.io [45.79.224.9]) by spool.mail.gandi.net (Postfix) with ESMTPS id 2D648D801B3 for ; Tue, 16 Apr 2024 14:54:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=OI/m8c1XVErj7OK/d5kQz+EARMFtaFyoWNt92aRgmpw=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1713279278; v=1; b=ZZsXwLTEuoL+OLGZTEq+z+yHu7BmMWYk7uGqadq7y5H5LvN8hC2O/xYpIS4j23T/aE/QL2fX z0WUu4onktY+bdn00xRZD0s1z2MS9PGf4H739CcxQ+3Q/URJbclN86KZsBkvt2K/P1R/rvDrW9e UmosEWOkhpGPHa2U/zKLH7zVlLixW7dQWBqZ5lY60PbRPuq0ODFl7B/8krO/Vb/UKd1y3rjixfb 7mOjOwmCE0U6NK+NV0OhqwwR1vAWCfO27PNoGcJeKskwkI+0VhRf28cCvTH9F6DNsI3PMCce1uz FiGAA51Dv+kguEG50pOOGHfIZL0Nb8SIpGQ83BCUkecZw== X-Received: by 127.0.0.2 with SMTP id vupZYY7687511xaKUfRNJ7uo; Tue, 16 Apr 2024 07:54:38 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.23019.1713279273207835663 for ; Tue, 16 Apr 2024 07:54:33 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 040361063; Tue, 16 Apr 2024 07:55:01 -0700 (PDT) X-Received: from beelzebub.ast.arm.com (u203013-lin.austin.arm.com [10.118.29.240]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9DD903F792; Tue, 16 Apr 2024 07:54:32 -0700 (PDT) From: "Stuart Yoder" To: devel@edk2.groups.io, Edhaya.Chandran@arm.com, gaojie@byosoft.com.cn Cc: Alex_Fox@phoenix.com, heinrich.schuchardt@canonical.com, David_Wright@phoenix.com, lichao@loongson.cn Subject: [edk2-devel] [PATCH v2 2/4] uefi-sct/SctPkg: TCG2 Protocol: use OFFSET_OF for computing offsets Date: Tue, 16 Apr 2024 09:53:59 -0500 Message-Id: <20240416145401.3213797-3-stuart.yoder@arm.com> In-Reply-To: <20240416145401.3213797-1-stuart.yoder@arm.com> References: <20240416145401.3213797-1-stuart.yoder@arm.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 Resent-Date: Tue, 16 Apr 2024 07:54:33 -0700 Resent-From: stuart.yoder@arm.com Reply-To: devel@edk2.groups.io,stuart.yoder@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1HxqDxqLS2Gmv0kn0yTpxAkpx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=ZZsXwLTE; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.9 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) Use compiler-independent OFFSET_OF macro defined from Base.h instead of the GCC specific __builtin_offsetof Signed-off-by: Stuart Yoder --- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2Protoco= lBBTestConformance.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest= /TCG2ProtocolBBTestConformance.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Prot= ocol/TCG2/BlackBoxTest/TCG2ProtocolBBTestConformance.c index 0122458a89fe..cba1ec1b9e2c 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2Pr= otocolBBTestConformance.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/TCG2/BlackBoxTest/TCG2Pr= otocolBBTestConformance.c @@ -25,8 +25,7 @@ Abstract: --*/ =20 #include "TCG2ProtocolBBTest.h" - -#define offsetof(st, m) __builtin_offsetof(st, m) +#include =20 /** * @brief Entrypoint for GetCapability() Function Test. @@ -475,7 +474,7 @@ BBTestGetCapabilityConformanceTestCheckpoint4 ( =20 // set size of struct to be up to and including the ManufacturerID // (this acts like a client with a 1.0 version of the struct) - BootServiceCap.Size =3D offsetof(EFI_TCG2_BOOT_SERVICE_CAPABILITY, Num= berOfPcrBanks); + BootServiceCap.Size =3D OFFSET_OF(EFI_TCG2_BOOT_SERVICE_CAPABILITY, Nu= mberOfPcrBanks); =20 Status =3D TCG2->GetCapability ( TCG2, @@ -494,7 +493,7 @@ BBTestGetCapabilityConformanceTestCheckpoint4 ( } =20 // Verify returned Size equals the size of EFI_TCG2_BOOT_SERVICE_CAPAB= ILITY up to and including the ManufacturerID field. - if (BootServiceCap.Size !=3D offsetof(EFI_TCG2_BOOT_SERVICE_CAPABILITY= , NumberOfPcrBanks)) { + if (BootServiceCap.Size !=3D OFFSET_OF(EFI_TCG2_BOOT_SERVICE_CAPABILIT= Y, NumberOfPcrBanks)) { StandardLib->RecordMessage ( StandardLib, EFI_VERBOSE_LEVEL_DEFAULT, --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117884): https://edk2.groups.io/g/devel/message/117884 Mute This Topic: https://groups.io/mt/105558007/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-