From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C4B482253FB50 for ; Fri, 9 Mar 2018 11:59:14 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA18981A8B7F; Fri, 9 Mar 2018 20:05:31 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-125-183.rdu2.redhat.com [10.10.125.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85A8B2166BAE; Fri, 9 Mar 2018 20:05:30 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 9 Mar 2018 21:05:24 +0100 Message-Id: <20180309200525.27376-2-lersek@redhat.com> In-Reply-To: <20180309200525.27376-1-lersek@redhat.com> References: <20180309200525.27376-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 09 Mar 2018 20:05:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 09 Mar 2018 20:05:31 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [PATCH 1/2] OvmfPkg/Tcg2ConfigPei: trivial coding style updates X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2018 19:59:15 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the @file comment block should match between INF and main C file - rewrap / refill columns to 79 characters - insert space before opening paren - prefix and suffix //-style comment block with empty // lines - fix indentation of arguments in multi-line function call - general tab spacing (indent step) is 2 in edk2, unlike QEMU's 4 No functional changes. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Marc-André Lureau Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek --- OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 20 +++---- OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c | 55 +++++++++++--------- 2 files changed, 40 insertions(+), 35 deletions(-) diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf index 234cdd6cb40c..8c2d5863ea6c 100644 --- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf +++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf @@ -1,20 +1,20 @@ ## @file -# Set TPM device type +# Set TPM device type # -# In SecurityPkg, this module initializes the TPM device type based on -# a UEFI variable and/or hardware detection. In OvmfPkg, the module -# only performs TPM2 hardware detection. +# In SecurityPkg, this module initializes the TPM device type based on a UEFI +# variable and/or hardware detection. In OvmfPkg, the module only performs TPM2 +# hardware detection. # # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
# Copyright (C) 2018, Red Hat, Inc. # -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at +# This program and the accompanying materials are licensed and made available +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ## [Defines] @@ -40,7 +40,7 @@ [LibraryClasses] Tpm2DeviceLib [Guids] - gEfiTpmDeviceSelectedGuid ## PRODUCES ## GUID # Used as a PPI GUID + gEfiTpmDeviceSelectedGuid ## PRODUCES ## GUID # Used as a PPI GUID gEfiTpmDeviceInstanceTpm20DtpmGuid ## SOMETIMES_CONSUMES [Ppis] diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c index 8bee1926b3c4..0befc6c54c87 100644 --- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c +++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c @@ -1,17 +1,20 @@ /** @file - The module entry point for Tcg2 configuration module. + Set TPM device type -Copyright (c) 2018, Red Hat, Inc. -Copyright (c) 2015, Intel Corporation. All rights reserved.
+ In SecurityPkg, this module initializes the TPM device type based on a UEFI + variable and/or hardware detection. In OvmfPkg, the module only performs TPM2 + hardware detection. -This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php + Copyright (c) 2015, Intel Corporation. All rights reserved.
+ Copyright (C) 2018, Red Hat, Inc. -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -55,23 +58,25 @@ Tcg2ConfigPeimEntryPoint ( Status = Tpm2RequestUseTpm (); if (!EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, "%a: TPM2 detected\n", __FUNCTION__)); - Size = sizeof(gEfiTpmDeviceInstanceTpm20DtpmGuid); - Status = PcdSetPtrS ( - PcdTpmInstanceGuid, - &Size, - &gEfiTpmDeviceInstanceTpm20DtpmGuid - ); - ASSERT_EFI_ERROR (Status); + DEBUG ((DEBUG_INFO, "%a: TPM2 detected\n", __FUNCTION__)); + Size = sizeof (gEfiTpmDeviceInstanceTpm20DtpmGuid); + Status = PcdSetPtrS ( + PcdTpmInstanceGuid, + &Size, + &gEfiTpmDeviceInstanceTpm20DtpmGuid + ); + ASSERT_EFI_ERROR (Status); } else { - DEBUG ((DEBUG_INFO, "%a: no TPM2 detected\n", __FUNCTION__)); - // If no TPM2 was detected, we still need to install - // TpmInitializationDonePpi. Namely, Tcg2Pei will exit early upon - // seeing the default (all-bits-zero) contents of - // PcdTpmInstanceGuid, thus we have to install the PPI in its place, - // in order to unblock any dependent PEIMs. - Status = PeiServicesInstallPpi (&mTpmInitializationDonePpiList); - ASSERT_EFI_ERROR (Status); + DEBUG ((DEBUG_INFO, "%a: no TPM2 detected\n", __FUNCTION__)); + // + // If no TPM2 was detected, we still need to install + // TpmInitializationDonePpi. Namely, Tcg2Pei will exit early upon seeing + // the default (all-bits-zero) contents of PcdTpmInstanceGuid, thus we have + // to install the PPI in its place, in order to unblock any dependent + // PEIMs. + // + Status = PeiServicesInstallPpi (&mTpmInitializationDonePpiList); + ASSERT_EFI_ERROR (Status); } // -- 2.14.1.3.gb7cf6e02401b