Skip to contentSkip to conversation

crypto: tegra: fix size_t format string

PATCH In review Arnd Bergmann 2 participants 2 messages Mar 14, 2025 – Mar 21, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: tegra: fix size_t format string

From: Arnd Bergmann <[email protected]>

Printing size_t as %lu causes a warning when it is defined as 'unsigned int':

drivers/crypto/tegra/tegra-se-hash.c:344:22: error: format specifies type 'unsigned long' but the argument has type 'ssize_t' (aka 'int') [-Werror,-Wformat]

  343 |         dev_dbg(se->dev, "msg len %llu msg left %llu sz %lu cfg %#x",
      |                                                         ~~~
      |                                                         %zd

Use %zu as the proper format string.

Fixes ff4b7df0b511 ("crypto: tegra - Fix HASH intermediate result handling")
---
 drivers/crypto/tegra/tegra-se-hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/tegra/tegra-se-hash.c +1 -1
index 65a50f29bd7e..ed86235fe518 100644
@@ -340,7 +340,7 @@ static int tegra_sha_prep_cmd(struct tegra_sha_ctx *ctx, u32 *cpuvaddr,
 	cpuvaddr[i++] = host1x_uclass_incr_syncpt_cond_f(1) |
 			host1x_uclass_incr_syncpt_indx_f(se->syncpt_id);
 
-	dev_dbg(se->dev, "msg len %llu msg left %llu sz %lu cfg %#x",
+	dev_dbg(se->dev, "msg len %llu msg left %llu sz %zu cfg %#x",
 		msg_len, msg_left, rctx->datbuf.size, rctx->config);
 
 	return i;
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 9 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Printing size_t as %lu causes a warning when it is defined as 'unsigned int':

drivers/crypto/tegra/tegra-se-hash.c:344:22: error: format specifies type 'unsigned long' but the argument has type 'ssize_t' (aka 'int') [-Werror,-Wformat]

  343 |         dev_dbg(se->dev, "msg len %llu msg left %llu sz %lu cfg %#x",
      |                                                         ~~~
      |                                                         %zd
Quoted 7 lines

Use %zu as the proper format string.

Fixes ff4b7df0b511 ("crypto: tegra - Fix HASH intermediate result handling")
---
 drivers/crypto/tegra/tegra-se-hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

A similar patch has already been applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt