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 F1C0C7803D2 for ; Mon, 15 Apr 2024 22:23:36 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dkZuStJW4BxqHtv50YFVfYLBS0zn9WLDXEwc1E6mb04=; 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=1713219815; v=1; b=FYVZkN1WM3KUGTOSnWfbXLn0mJNVelwEO/5/qpOsYL4cbzCFHSj0w6H9krFt7WtVoqXRZ7T1 lc/NlXWvHSJ3CQoCCGvBhZZGRkpUizd6WH0nfiDDwlo/i4ke6WODREJVu2NFhuNsSmafJ9CAB2Q CHNJxzPlopXKA0ZJL8ERJWGBC4adTFnH5IxjpKs1z0nJQEx4qudNbgo5Ybtb5RA0z3/92JrphYV y4qR/LDfpeq8X2DJhdIzstPOo/f5YAAxv8UdIGbblro/lRy/j7LLh8Qcq4mtcHnbmFdvhqtQSq5 f9d1nfVhLxMYvoA7imh6bYjlL3U84EPiUlMQVY3jPHESQ== X-Received: by 127.0.0.2 with SMTP id uUgrYY7687511x0hADtIRtoI; Mon, 15 Apr 2024 15:23:35 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.5962.1713219812909581625 for ; Mon, 15 Apr 2024 15:23: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 3220E1516; Mon, 15 Apr 2024 15:24: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 57A473F738; Mon, 15 Apr 2024 15:23: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 v1 2/3] uefi-sct/SctPkg: TCG2 Protocol: use OFFSET_OF for computing offsets Date: Mon, 15 Apr 2024 17:23:21 -0500 Message-Id: <20240415222322.3167566-3-stuart.yoder@arm.com> In-Reply-To: <20240415222322.3167566-1-stuart.yoder@arm.com> References: <20240415222322.3167566-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: Mon, 15 Apr 2024 15:23: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: xs6jWrIMPEGoFGkhhnoIhJfHx7686176AA= 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=FYVZkN1W; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.9 as permitted sender) smtp.mailfrom=bounce@groups.io 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 (#117809): https://edk2.groups.io/g/devel/message/117809 Mute This Topic: https://groups.io/mt/105546456/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-