diff options
author | Jon Murphy <jpmurphy@google.com> | 2023-09-26 21:05:37 -0600 |
---|---|---|
committer | Raul Rangel <rrangel@chromium.org> | 2023-09-28 16:54:31 +0000 |
commit | 53fc667943052bd592b8406bdf4bf652c6c9cd3a (patch) | |
tree | b5729589da0f5b77fd3898a03648bef60ab5a11a /src/vendorcode | |
parent | 901f0400b701791524301ce4ab2ba5bd028e7e2b (diff) |
treewide: convert to %#x hex prints
Convert hex print values to use the %#x qualifier to print 0x{value}.
BUG=b:296439237
TEST=build and boot to Skyrim
BRANCH=None
Change-Id: I0d1ac4b920530635fb758c5165a6a99c11b414c8
Signed-off-by: Jon Murphy <jpmurphy@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78183
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/vendorcode')
-rw-r--r-- | src/vendorcode/eltan/security/mboot/mboot.c | 18 | ||||
-rw-r--r-- | src/vendorcode/eltan/security/verified_boot/vboot_check.c | 6 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/cr50_enable_update.c | 8 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/cse_board_reset.c | 2 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/tpm2.c | 4 |
5 files changed, 19 insertions, 19 deletions
diff --git a/src/vendorcode/eltan/security/mboot/mboot.c b/src/vendorcode/eltan/security/mboot/mboot.c index ac7ce4be8e..783f587323 100644 --- a/src/vendorcode/eltan/security/mboot/mboot.c +++ b/src/vendorcode/eltan/security/mboot/mboot.c @@ -47,7 +47,7 @@ EFI_TCG2_EVENT_ALGORITHM_BITMAP tpm2_get_active_pcrs(void) case TPM_ALG_SM3_256: default: printk(BIOS_DEBUG, "%s: unsupported algorithm " - "reported - 0x%x\n", __func__, + "reported - %#x\n", __func__, Pcrs.pcrSelections[index].hash); break; } @@ -88,7 +88,7 @@ int tpm2_get_capability_pcrs(TPML_PCR_SELECTION *Pcrs) for (index = 0; index < Pcrs->count; index++) { Pcrs->pcrSelections[index].hash = swab16(TpmCap.data.assignedPCR.pcrSelections[index].hash); - printk(BIOS_DEBUG, "Pcrs->pcrSelections[%d].hash = 0x%x\n", index, + printk(BIOS_DEBUG, "Pcrs->pcrSelections[%d].hash = %#x\n", index, Pcrs->pcrSelections[index].hash); Pcrs->pcrSelections[index].sizeofSelect = TpmCap.data.assignedPCR.pcrSelections[index].sizeofSelect; @@ -166,7 +166,7 @@ void invalidate_pcrs(void) (uint8_t *)"Invalidate PCR"); if (rc != TPM_SUCCESS) printk(BIOS_DEBUG, "%s: invalidating pcr %d returned" - " 0x%x\n", __func__, pcr, rc); + " %#x\n", __func__, pcr, rc); } } @@ -291,7 +291,7 @@ __weak int mb_entry(int wake_from_s3) } if (rc) - printk(BIOS_ERR, "%s: StartUp failed 0x%x!\n", __func__, rc); + printk(BIOS_ERR, "%s: StartUp failed %#x!\n", __func__, rc); return rc; } @@ -327,12 +327,12 @@ __weak int mb_measure(int wake_from_s3) printk(BIOS_DEBUG, "%s: Measuring, successful!\n", __func__); } else { invalidate_pcrs(); - printk(BIOS_ERR, "%s: Measuring returned 0x%x unsuccessful! PCRs invalidated.\n", + printk(BIOS_ERR, "%s: Measuring returned %#x unsuccessful! PCRs invalidated.\n", __func__, rc); } } else { invalidate_pcrs(); - printk(BIOS_ERR, "%s: StartUp returned 0x%x, unsuccessful! PCRs invalidated.\n", __func__, + printk(BIOS_ERR, "%s: StartUp returned %#x, unsuccessful! PCRs invalidated.\n", __func__, rc); } return rc; @@ -433,13 +433,13 @@ __weak int mb_crtm(void) rc = mboot_hash_extend_log(0, (uint8_t *)crtm_version, tcgEventHdr.eventSize, &tcgEventHdr, (uint8_t *)crtm_version); if (rc) { - printk(BIOS_DEBUG, "Measure CRTM Version returned 0x%x\n", rc); + printk(BIOS_DEBUG, "Measure CRTM Version returned %#x\n", rc); return rc; } rc = get_intel_me_hash(hash); if (rc) { - printk(BIOS_DEBUG, "get_intel_me_hash returned 0x%x\n", rc); + printk(BIOS_DEBUG, "get_intel_me_hash returned %#x\n", rc); rc = TPM_IOERROR; return rc; } @@ -456,7 +456,7 @@ __weak int mb_crtm(void) rc = mboot_hash_extend_log(MBOOT_HASH_PROVIDED, hash, sizeof(hash), &tcgEventHdr, msgPtr); if (rc) - printk(BIOS_DEBUG, "Add ME hash returned 0x%x\n", rc); + printk(BIOS_DEBUG, "Add ME hash returned %#x\n", rc); return rc; } diff --git a/src/vendorcode/eltan/security/verified_boot/vboot_check.c b/src/vendorcode/eltan/security/verified_boot/vboot_check.c index a8c6cb537b..9ea31b877c 100644 --- a/src/vendorcode/eltan/security/verified_boot/vboot_check.c +++ b/src/vendorcode/eltan/security/verified_boot/vboot_check.c @@ -256,7 +256,7 @@ void process_verify_list(const verify_item_t list[]) list[i].hash_index, list[i].pcr); break; default: - printk(BIOS_EMERG, "INVALID TYPE IN VERIFY LIST 0x%x\n", list[i].type); + printk(BIOS_EMERG, "INVALID TYPE IN VERIFY LIST %#x\n", list[i].type); die("HASH verification failed!\n"); } i++; @@ -289,7 +289,7 @@ void verified_boot_early_check(void) printk(BIOS_SPEW, "%s: processing early items\n", __func__); if (CONFIG(VENDORCODE_ELTAN_MBOOT)) { - printk(BIOS_DEBUG, "mb_measure returned 0x%x\n", + printk(BIOS_DEBUG, "mb_measure returned %#x\n", mb_measure(platform_is_resuming())); } @@ -338,7 +338,7 @@ static int process_oprom_list(const verify_item_t list[], } break; default: - printk(BIOS_EMERG, "%s: INVALID TYPE IN OPTION ROM LIST 0x%x\n", + printk(BIOS_EMERG, "%s: INVALID TYPE IN OPTION ROM LIST %#x\n", __func__, list[i].type); die("HASH verification failed!\n"); } diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c index aea804f026..abc132dd6e 100644 --- a/src/vendorcode/google/chromeos/cr50_enable_update.c +++ b/src/vendorcode/google/chromeos/cr50_enable_update.c @@ -45,7 +45,7 @@ static int cr50_is_reset_needed(void) return 1; } else if (rc != TPM_SUCCESS) { /* TPM command failed, continue booting. */ - printk(BIOS_ERR, "Attempt to get CR50 TPM mode failed: %x\n", rc); + printk(BIOS_ERR, "Attempt to get CR50 TPM mode failed: %#x\n", rc); return 0; } @@ -85,7 +85,7 @@ static void enable_update(void *unused) rc = tlcl_lib_init(); if (rc != VB2_SUCCESS) { - printk(BIOS_ERR, "tlcl_lib_init() failed for CR50 update: %x\n", + printk(BIOS_ERR, "tlcl_lib_init() failed for CR50 update: %#x\n", rc); return; } @@ -97,7 +97,7 @@ static void enable_update(void *unused) &num_restored_headers); if (rc != TPM_SUCCESS) { - printk(BIOS_ERR, "Attempt to enable CR50 update failed: %x\n", + printk(BIOS_ERR, "Attempt to enable CR50 update failed: %#x\n", rc); return; } @@ -150,7 +150,7 @@ static void enable_update(void *unused) * booting but the current boot will likely end up at * the recovery screen. */ - printk(BIOS_ERR, "Attempt to reset CR50 failed: %x\n", + printk(BIOS_ERR, "Attempt to reset CR50 failed: %#x\n", rc); return; } diff --git a/src/vendorcode/google/chromeos/cse_board_reset.c b/src/vendorcode/google/chromeos/cse_board_reset.c index 7d19408726..87c49164c0 100644 --- a/src/vendorcode/google/chromeos/cse_board_reset.c +++ b/src/vendorcode/google/chromeos/cse_board_reset.c @@ -23,7 +23,7 @@ void cse_board_reset(void) /* Initialize TPM and get the cr50 firmware version. */ rc = tlcl_lib_init(); if (rc != VB2_SUCCESS) { - printk(BIOS_ERR, "tlcl_lib_init() failed: 0x%x\n", rc); + printk(BIOS_ERR, "tlcl_lib_init() failed: %#x\n", rc); return; } diff --git a/src/vendorcode/google/chromeos/tpm2.c b/src/vendorcode/google/chromeos/tpm2.c index a28b02eeaf..8e3a4ebb51 100644 --- a/src/vendorcode/google/chromeos/tpm2.c +++ b/src/vendorcode/google/chromeos/tpm2.c @@ -18,13 +18,13 @@ static void disable_platform_hierarchy(void *unused) rc = tlcl_lib_init(); if (rc != VB2_SUCCESS) { - printk(BIOS_ERR, "tlcl_lib_init() failed: %x\n", rc); + printk(BIOS_ERR, "tlcl_lib_init() failed: %#x\n", rc); return; } rc = tlcl_disable_platform_hierarchy(); if (rc != TPM_SUCCESS) - printk(BIOS_ERR, "Platform hierarchy disablement failed: %x\n", + printk(BIOS_ERR, "Platform hierarchy disablement failed: %#x\n", rc); } |