From: Laszlo Ersek <lersek@redhat.com>
To: edk2-devel-01 <edk2-devel@lists.01.org>
Cc: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>,
"Jordan Justen" <jordan.l.justen@intel.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PATCH 1/2] OvmfPkg/Tcg2ConfigPei: trivial coding style updates
Date: Fri, 9 Mar 2018 21:05:24 +0100 [thread overview]
Message-ID: <20180309200525.27376-2-lersek@redhat.com> (raw)
In-Reply-To: <20180309200525.27376-1-lersek@redhat.com>
- 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 <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
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.<BR>
# 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.<BR>
+ 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.<BR>
+ 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
next prev parent reply other threads:[~2018-03-09 19:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 20:05 [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Laszlo Ersek
2018-03-09 20:05 ` Laszlo Ersek [this message]
2018-03-09 20:05 ` [PATCH 2/2] SecurityPkg/TcgPei: drop PeiReadOnlyVariable from Depex Laszlo Ersek
2018-03-09 23:12 ` Yao, Jiewen
2018-03-13 1:20 ` Zhang, Chao B
2018-03-09 23:50 ` [PATCH 0/2] OvmfPkg, SecurityPkg: small followup patches after the TPM2 addition to OVMF Jordan Justen
2018-03-10 15:34 ` Laszlo Ersek
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=20180309200525.27376-2-lersek@redhat.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