Philipp Deppenwiese has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31816
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
security/tpm: Apply clang-format with new changes
* Fix 80 lines length issues as expected
Change-Id: Ieeb675e96b95f6bf2d6a5b9d2be3ca8fd4ed6946 Signed-off-by: Philipp Deppenwiese zaolin.daisuki@gmail.com --- M src/security/tpm/tspi/log.c 1 file changed, 16 insertions(+), 17 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/31816/1
diff --git a/src/security/tpm/tspi/log.c b/src/security/tpm/tspi/log.c index 18ab288..dc8a1e4 100644 --- a/src/security/tpm/tspi/log.c +++ b/src/security/tpm/tspi/log.c @@ -33,8 +33,9 @@ if (cbmem_possibly_online()) { tclt = cbmem_find(CBMEM_ID_TCPA_LOG); if (!tclt) { - size_t tcpa_log_len = sizeof(struct tcpa_table) + - MAX_TCPA_LOG_ENTRIES * sizeof(struct tcpa_entry); + size_t tcpa_log_len = + sizeof(struct tcpa_table) + + MAX_TCPA_LOG_ENTRIES * sizeof(struct tcpa_entry); tclt = cbmem_add(CBMEM_ID_TCPA_LOG, tcpa_log_len); if (tclt) { tclt->max_entries = MAX_TCPA_LOG_ENTRIES; @@ -51,11 +52,9 @@
/* We are dealing here with pre CBMEM environment. * If cbmem isn't available use CAR or SRAM */ - if (!cbmem_possibly_online() && - !IS_ENABLED(CONFIG_VBOOT_RETURN_FROM_VERSTAGE)) + if (!cbmem_possibly_online() && !IS_ENABLED(CONFIG_VBOOT_RETURN_FROM_VERSTAGE)) return (struct tcpa_table *)_vboot2_tpm_log; - else if (ENV_ROMSTAGE && - !IS_ENABLED(CONFIG_VBOOT_RETURN_FROM_VERSTAGE)) { + else if (ENV_ROMSTAGE && !IS_ENABLED(CONFIG_VBOOT_RETURN_FROM_VERSTAGE)) { tclt = tcpa_cbmem_init(); if (!tclt) return (struct tcpa_table *)_vboot2_tpm_log; @@ -84,17 +83,15 @@ for (j = 0; j < tce->digest_length; j++) printk(BIOS_INFO, "%02x", tce->digest[j]);
- printk(BIOS_INFO, " %s [%s]\n", - tce->digest_type, tce->name); + printk(BIOS_INFO, " %s [%s]\n", tce->digest_type, tce->name); } } printk(BIOS_INFO, "\n"); }
void tcpa_log_add_table_entry(const char *name, const uint32_t pcr, - enum vb2_hash_algorithm digest_algo, - const uint8_t *digest, - const size_t digest_len) + enum vb2_hash_algorithm digest_algo, const uint8_t *digest, + const size_t digest_len) { struct tcpa_table *tclt = tcpa_log_init(); if (!tclt) { @@ -121,9 +118,8 @@ return; }
- strncpy(tce->digest_type, - vb2_get_hash_algorithm_name(digest_algo), - TCPA_PCR_HASH_LEN - 1); + strncpy(tce->digest_type, vb2_get_hash_algorithm_name(digest_algo), + TCPA_PCR_HASH_LEN - 1); tce->digest_length = digest_len; memcpy(tce->digest, digest, tce->digest_length); } @@ -144,7 +140,8 @@ int i;
if (preram_log->num_entries > MAX_PRERAM_TCPA_LOG_ENTRIES) { - printk(BIOS_WARNING, "TCPA: Pre-RAM TCPA log is too full, possible corruption\n"); + printk(BIOS_WARNING, + "TCPA: Pre-RAM TCPA log is too full, possible corruption\n"); return; }
@@ -164,8 +161,10 @@ return; }
- strncpy(tce->digest_type, preram_log->entries[i].digest_type, TCPA_PCR_HASH_LEN - 1); - tce->digest_length = MIN(preram_log->entries[i].digest_length, TCPA_DIGEST_MAX_LENGTH); + strncpy(tce->digest_type, preram_log->entries[i].digest_type, + TCPA_PCR_HASH_LEN - 1); + tce->digest_length = + MIN(preram_log->entries[i].digest_length, TCPA_DIGEST_MAX_LENGTH); memcpy(tce->digest, preram_log->entries[i].digest, tce->digest_length); } }
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31816 )
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
Patch Set 1: Code-Review+2
Hello Werner Zeh, Julius Werner, build bot (Jenkins), Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31816
to look at the new patch set (#2).
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
security/tpm: Apply clang-format with new changes
* Fix 80 lines length issues as expected
Change-Id: Ieeb675e96b95f6bf2d6a5b9d2be3ca8fd4ed6946 Signed-off-by: Philipp Deppenwiese zaolin.daisuki@gmail.com --- M src/security/tpm/tspi.h M src/security/tpm/tspi/log.c M src/security/tpm/tspi/tspi.c 3 files changed, 27 insertions(+), 36 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/31816/2
Hello Werner Zeh, Julius Werner, build bot (Jenkins), Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31816
to look at the new patch set (#3).
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
security/tpm: Apply clang-format with new changes
* Fix 80 lines length issues as expected * Fix only the TPM TSPI layer
Change-Id: Ieeb675e96b95f6bf2d6a5b9d2be3ca8fd4ed6946 Signed-off-by: Philipp Deppenwiese zaolin.daisuki@gmail.com --- M src/security/tpm/tspi.h M src/security/tpm/tspi/log.c M src/security/tpm/tspi/tspi.c 3 files changed, 27 insertions(+), 36 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/31816/3
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31816 )
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
Patch Set 3: Code-Review+2
(1 comment)
https://review.coreboot.org/#/c/31816/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/31816/3//COMMIT_MSG@9 PS3, Line 9: 80 We're at 96 now. Also 96 columns line length, I don't think we ask to limit files to 80 (or 96) lines or less ;-)
Hello Werner Zeh, Julius Werner, build bot (Jenkins), Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31816
to look at the new patch set (#4).
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
security/tpm: Apply clang-format with new changes
* Fix 96 line length issues as expected * Fix only the TPM TSPI layer
Change-Id: Ieeb675e96b95f6bf2d6a5b9d2be3ca8fd4ed6946 Signed-off-by: Philipp Deppenwiese zaolin.daisuki@gmail.com --- M src/security/tpm/tspi.h M src/security/tpm/tspi/log.c M src/security/tpm/tspi/tspi.c 3 files changed, 27 insertions(+), 36 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/31816/4
Hello Werner Zeh, Julius Werner, build bot (Jenkins), Patrick Georgi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31816
to look at the new patch set (#5).
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
security/tpm: Apply clang-format with new changes
* Fix line length issues * Fix only the TPM TSPI layer
Change-Id: Ieeb675e96b95f6bf2d6a5b9d2be3ca8fd4ed6946 Signed-off-by: Philipp Deppenwiese zaolin.daisuki@gmail.com --- M src/security/tpm/tspi.h M src/security/tpm/tspi/log.c M src/security/tpm/tspi/tspi.c 3 files changed, 27 insertions(+), 36 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/31816/5
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31816 )
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
Patch Set 5: Code-Review-1
(1 comment)
coreboot line length is 80 characters, I'm not aware of any conclusive decision to the contrary. The latest discussion about this I'm aware of was https://review.coreboot.org/c/coreboot/+/27533, which petered out without result.
https://review.coreboot.org/#/c/31816/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/31816/3//COMMIT_MSG@9 PS3, Line 9: 80
We're at 96 now. […]
...I don't think so? I recall we had a huge discussion about this and some sort of vote was planned that never happened, but I'm pretty sure there was no agreement to change yet. (FTR I'm still strongly against changing away from 80 for all the reasons we already discussed to death back then.)
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31816 )
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
Patch Set 5: Code-Review-1
Doesn't look like this is in accordance with our coding style.
Philipp Deppenwiese has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31816 )
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
Patch Set 5:
Guys I am just applying the clang-format here. Whatever happens with the completely stubborn discussion for the line length, do me a favor and take back the -1. I will rebase and re-apply clang-format on the outcome
Martin L Roth has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/31816?usp=email )
Change subject: security/tpm: Apply clang-format with new changes ......................................................................
Abandoned
This patch has not been touched in over 12 months. Anyone who wants to take over work on this patch, please feel free to restore it and do any work needed to get it merged. If you create a new patch based on this work, please credit the original author.