From 38f3ffad3fa05cf37ec44eda053006235c8d8d43 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Tue, 31 Jul 2018 14:26:39 -0700 Subject: security/tpm/tspi: Set return type of tcpa_log_add_table_entry as void Change f849972 (security/vboot: Enable TCPA log extension) enabled support for adding TCPA log to CBMEM. However, if CBMEM is not online, this function doesn't do anything and returns early. This condition is not really a valid error condition as it depends on when the call to tcpa_log_add_table_entry is made. Since tcpa_log_add_table_entry returns -1 when cbmem is not online, tpm_extend_pcr prints an error message with prefix "ERROR:". This can confuse any scripts trying to catch errors in boot flow. This CL makes the following changes: 1. Removes the print in tpm_extend_pcr since tcpa_log_add_table_entry already prints out appropriate ERROR messages in case of failure to add log entry. 2. Since the return value of tcpa_log_add_table_entry is not used anymore, return type for tcpa_log_add_table_entry is changed to void. BUG=b:112030232 Change-Id: I32d313609a3e57845e67059b3747b81b5c8adb2a Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/27757 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese Reviewed-by: Justin TerAvest --- src/security/tpm/tspi.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/security/tpm/tspi.h') diff --git a/src/security/tpm/tspi.h b/src/security/tpm/tspi.h index 43254c13d1..94b53b054a 100644 --- a/src/security/tpm/tspi.h +++ b/src/security/tpm/tspi.h @@ -28,8 +28,9 @@ void tcpa_log_init(void); /** * Add table entry for cbmem TCPA log. */ -int tcpa_log_add_table_entry(const char *name, const uint32_t pcr, - const uint8_t *digest, const size_t digest_length); +void tcpa_log_add_table_entry(const char *name, const uint32_t pcr, + const uint8_t *digest, + const size_t digest_length); /** * Ask vboot for a digest and extend a TPM PCR with it. -- cgit v1.2.3