From 6a50bb98f24929c9fc69e9197eb21c142e061fbd Mon Sep 17 00:00:00 2001 From: Prasad J Pandit Date: Tue, 6 Nov 2018 10:51:44 +0530 Subject: [PATCH 1/2] tpm: use loop iterator to set sts data field When TIS request is done, set 'sts' data field across all localities. Signed-off-by: Prasad J Pandit Reviewed-by: Stefan Berger Signed-off-by: Stefan Berger --- hw/tpm/tpm_tis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 12f5c9a759..d9322692ee 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -295,7 +295,7 @@ static void tpm_tis_request_completed(TPMIf *ti, int ret) if (s->cmd.selftest_done) { for (l = 0; l < TPM_TIS_NUM_LOCALITIES; l++) { - s->loc[locty].sts |= TPM_TIS_STS_SELFTEST_DONE; + s->loc[l].sts |= TPM_TIS_STS_SELFTEST_DONE; } } From 5e58b58c478bd00c807bd7814ccab148d49cc901 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 6 Nov 2018 09:08:40 -0500 Subject: [PATCH 2/2] tests: tpm: Use g_test_message rather than fprintf Display a message during the test using g_test_message rather than fprintf. Signed-off-by: Stefan Berger Reviewed-by: Thomas Huth --- tests/tpm-tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tpm-tests.c b/tests/tpm-tests.c index 93a5beba01..582ec0cfd4 100644 --- a/tests/tpm-tests.c +++ b/tests/tpm-tests.c @@ -22,7 +22,7 @@ static bool tpm_test_swtpm_skip(void) { if (!tpm_util_swtpm_has_tpm2()) { - fprintf(stderr, "swtpm not in PATH or missing --tpm2 support; "); + g_test_message("swtpm not in PATH or missing --tpm2 support"); return true; }