]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
tpm: tpm_tis_infineon: Make use of 'z' for printing size_t
authorTom Rini <trini@konsulko.com>
Wed, 6 Aug 2025 14:55:19 +0000 (08:55 -0600)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Mon, 25 Aug 2025 10:04:21 +0000 (13:04 +0300)
When printing the contents of an size_t variable we need to use z prefix
to the format character in order to get the correct format type
depending on 32 or 64bit-ness.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
drivers/tpm/tpm_tis_infineon.c

index e2f6238cbc7115c97a580630384d2f309d01b460..de6566fdb9e501e3530d1f36e8e7dd7ddd599dae 100644 (file)
@@ -396,7 +396,7 @@ static int tpm_tis_i2c_recv(struct udevice *dev, u8 *buf, size_t count)
 
        expected = get_unaligned_be32(buf + TPM_RSP_SIZE_BYTE);
        if ((size_t)expected > count || (size_t)expected < TPM_HEADER_SIZE) {
-               debug("Error size=%x, expected=%x, count=%x\n", size, expected,
+               debug("Error size=%x, expected=%x, count=%zx\n", size, expected,
                      count);
                return -ENOSPC;
        }
@@ -429,7 +429,7 @@ static int tpm_tis_i2c_send(struct udevice *dev, const u8 *buf, size_t len)
        int retry = 0;
        u8 sts = TPM_STS_GO;
 
-       debug("%s: len=%d\n", __func__, len);
+       debug("%s: len=%zd\n", __func__, len);
        if (len > TPM_DEV_BUFSIZE)
                return -E2BIG;  /* Command is too long for our tpm, sorry */