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>
This commit is contained in:
Jon Murphy 2023-09-26 21:05:37 -06:00 committed by Raul Rangel
commit 53fc667943
21 changed files with 63 additions and 63 deletions

View file

@ -460,7 +460,7 @@ int tpm_vendor_init(struct tpm_chip *chip, unsigned int bus, uint32_t dev_addr)
if (claim_locality())
return -1;
printk(BIOS_DEBUG, "cr50 TPM 2.0 (i2c %u:0x%02x id 0x%x)\n",
printk(BIOS_DEBUG, "cr50 TPM 2.0 (i2c %u:0x%02x id %#x)\n",
bus, dev_addr, did_vid >> 16);
if (tpm_first_access_this_boot()) {

View file

@ -62,7 +62,7 @@ static ssize_t tpm_transmit(const uint8_t *sbuf, size_t sbufsiz, void *rbuf,
return -1;
}
if (count > sbufsiz) {
printk(BIOS_DEBUG, "%s: invalid count value %x %zx\n", __func__,
printk(BIOS_DEBUG, "%s: invalid count value %#x %zx\n", __func__,
count, sbufsiz);
return -1;
}

View file

@ -534,7 +534,7 @@ int tpm_vendor_init(struct tpm_chip *chip, unsigned int bus, uint32_t dev_addr)
goto out_err;
}
printk(BIOS_DEBUG, "I2C TPM %u:%02x (chip type %s device-id 0x%X)\n",
printk(BIOS_DEBUG, "I2C TPM %u:%02x (chip type %s device-id %#X)\n",
tpm_dev.bus, tpm_dev.addr,
chip_name[tpm_dev.chip_type], vendor >> 16);

View file

@ -35,9 +35,9 @@
printk(BIOS_DEBUG, fmt, ##args); \
}
#define TPM_DEBUG_IO_READ(reg_, val_) \
TPM_DEBUG("Read reg 0x%x returns 0x%x\n", (reg_), (val_))
TPM_DEBUG("Read reg %#x returns %#x\n", (reg_), (val_))
#define TPM_DEBUG_IO_WRITE(reg_, val_) \
TPM_DEBUG("Write reg 0x%x with 0x%x\n", (reg_), (val_))
TPM_DEBUG("Write reg %#x with %#x\n", (reg_), (val_))
#define printf(x...) printk(BIOS_ERR, x)
/* coreboot wrapper for TPM driver (end) */
@ -499,7 +499,7 @@ static u32 tis_senddata(const u8 *const data, u32 len)
* command.
*/
if (tis_wait_valid(locality) || tis_expect_data(locality)) {
printf("%s:%d unexpected TPM status 0x%x\n",
printf("%s:%d unexpected TPM status %#x\n",
__FILE__, __LINE__, tpm_read_status(locality));
return TPM_DRIVER_ERR;
}
@ -596,7 +596,7 @@ static u32 tis_readresponse(u8 *buffer, size_t *len)
/* * Make sure we indeed read all there was. */
if (tis_has_valid_data(locality)) {
printf("%s:%d wrong receive status: %x %u bytes left\n",
printf("%s:%d wrong receive status: %#x %u bytes left\n",
__FILE__, __LINE__, tpm_read_status(locality),
tpm_read_burst_count(locality));
return TPM_DRIVER_ERR;

View file

@ -509,7 +509,7 @@ static enum cb_err wait_for_status(uint32_t status_mask, uint32_t status_expecte
do {
udelay(1000);
if (stopwatch_expired(&sw)) {
printk(BIOS_ERR, "failed to get expected status %x\n",
printk(BIOS_ERR, "failed to get expected status %#x\n",
status_expected);
return CB_ERR;
}