]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tpm: Correct warning on 32-bit build
authorSimon Glass <sjg@chromium.org>
Sun, 7 Feb 2021 21:27:04 +0000 (14:27 -0700)
committerTom Rini <trini@konsulko.com>
Sat, 13 Mar 2021 18:14:52 +0000 (13:14 -0500)
Fix the warning:

drivers/tpm/tpm2_tis_sandbox.c: In function ‘sandbox_tpm2_xfer’:
drivers/tpm/tpm2_tis_sandbox.c:288:48: warning: format ‘%ld’ expects
argument of type ‘long int’, but argument 2 has type ‘size_t’
{aka ‘unsigned int’} [-Wformat=]
   printf("TPM2: Unmatching length, received: %ld, expected: %d\n",
                                              ~~^
                                              %d
          send_size, length);
          ~~~~~~~~~

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
drivers/tpm/tpm2_tis_sandbox.c

index c74bacfd719fcb50baf94ad1e41453c490dc0d89..24c804a56458d0900b1fec226da9068dde1287f1 100644 (file)
@@ -285,7 +285,7 @@ static int sandbox_tpm2_xfer(struct udevice *dev, const u8 *sendbuf,
        length = get_unaligned_be32(sent);
        sent += sizeof(length);
        if (length != send_size) {
-               printf("TPM2: Unmatching length, received: %ld, expected: %d\n",
+               printf("TPM2: Unmatching length, received: %zd, expected: %d\n",
                       send_size, length);
                rc = TPM2_RC_SIZE;
                sandbox_tpm2_fill_buf(recv, recv_len, tag, rc);