From 2dd7ea9b7a34fd02c10b67bccebfb3c04b7ab3bf Mon Sep 17 00:00:00 2001 From: root Date: Wed, 15 Mar 2017 13:50:51 +0000 Subject: patch up C99isms and a missing define --- tboot/tpm_20.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tboot/tpm_20.c') diff --git a/tboot/tpm_20.c b/tboot/tpm_20.c index 87007d0..45c4a6b 100644 --- a/tboot/tpm_20.c +++ b/tboot/tpm_20.c @@ -2199,13 +2199,14 @@ static uint32_t tpm20_save_state(struct tpm_if *ti, uint32_t locality) static bool tpm20_cap_pcrs(struct tpm_if *ti, u32 locality, int pcr) { bool was_capped[TPM_NR_PCRS] = {false}; + unsigned int i; hash_list_t cap_val; /* use whatever val is on stack */ if ( ti == NULL || locality >= TPM_NR_LOCALITIES || pcr == 0 ) return false; cap_val.count = ti->banks; - for (unsigned int i=0; ibanks; i++) + for (i=0; ibanks; i++) cap_val.entries[i].alg = ti->algs_banks[i]; if (pcr >= 0) { @@ -2235,7 +2236,8 @@ static bool tpm20_cap_pcrs(struct tpm_if *ti, u32 locality, int pcr) static bool alg_is_supported(u16 alg) { - for (int i=0; i<2; i++) { + int i; + for (i=0; i<2; i++) { if (alg == tboot_alg_list[i]) return true; } @@ -2319,7 +2321,7 @@ static bool tpm20_init(struct tpm_if *ti) } } printk(TBOOT_INFO"TPM: supported alg count = %08X\n", ti->alg_count); - for (unsigned int i=0; ialg_count; i++) + for (i=0; ialg_count; i++) printk(TBOOT_INFO"\t\t %08X\n", ti->algs[i]); if (handle2048 != 0) -- cgit v1.2.3