From 4e7703161e75fe10b4210a86ab17457a34742a60 Mon Sep 17 00:00:00 2001 From: yliu79 Date: Wed, 22 May 2019 10:22:55 -0700 Subject: [PATCH] DM: remove unused function swtpm_reset_tpm_established_flag Change-Id: I8253df84ef490418e37ac3d565dcdc7bb8123f3b Tracked-On: #3123 Signed-off-by: Ying Liu Acked-by: Anthony Xu --- devicemodel/hw/platform/tpm/tpm_emulator.c | 25 ---------------------- devicemodel/hw/platform/tpm/tpm_internal.h | 3 --- 2 files changed, 28 deletions(-) diff --git a/devicemodel/hw/platform/tpm/tpm_emulator.c b/devicemodel/hw/platform/tpm/tpm_emulator.c index 640bea964..6c260b163 100644 --- a/devicemodel/hw/platform/tpm/tpm_emulator.c +++ b/devicemodel/hw/platform/tpm/tpm_emulator.c @@ -762,31 +762,6 @@ bool swtpm_get_tpm_established_flag(void) return tpm_context.established_flag; } -int swtpm_reset_tpm_established_flag(void) -{ - ptm_reset_est reset_est; - ptm_res res; - - reset_est.u.req.loc = tpm_context.cur_locty_number; - if (swtpm_ctrlcmd(tpm_context.ctrl_chan_fd, CMD_RESET_TPMESTABLISHED, - &reset_est, sizeof(reset_est), - sizeof(reset_est), NULL, 0) < 0) { - printf("swtpm: Could not reset the establishment bit: %s", - strerror(errno)); - return -1; - } - - res = __builtin_bswap32(reset_est.u.resp.tpm_result); - if (res) { - printf("swtpm: TPM result for rest establixhed flag: 0x%x", res); - return -1; - } - - tpm_context.established_flag_cached = 0; - - return 0; -} - void swtpm_cancel_cmd(void) { ptm_res res = 0; diff --git a/devicemodel/hw/platform/tpm/tpm_internal.h b/devicemodel/hw/platform/tpm/tpm_internal.h index b3350153d..dcaf3333c 100644 --- a/devicemodel/hw/platform/tpm/tpm_internal.h +++ b/devicemodel/hw/platform/tpm/tpm_internal.h @@ -36,9 +36,6 @@ void deinit_tpm_emulator(void); /* Send Ctrl channel command CMD_GET_TPMESTABLISHED to SWTPM */ bool swtpm_get_tpm_established_flag(void); -/* Send Ctrl channel command CMD_RESET_TPMESTABLISHED to SWTPM */ -int swtpm_reset_tpm_established_flag(void); - /* Send TPM2 command request to SWTPM by using Cmd channel */ int swtpm_handle_request(TPMCommBuffer *cmd);