Commit 41e05324 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Herbert Xu

crypto: mediatek - fix format string for 64-bit builds

After I enabled COMPILE_TEST for non-ARM targets, I ran into these
warnings:

crypto/mediatek/mtk-aes.c: In function 'mtk_aes_info_map':
crypto/mediatek/mtk-aes.c:224:28: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format=]
   dev_err(cryp->dev, "dma %d bytes error\n", sizeof(*info));
crypto/mediatek/mtk-sha.c:344:28: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Werror=format=]
crypto/mediatek/mtk-sha.c:550:21: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'size_t {aka long unsigned int}' [-Werror=format=]

The correct format for size_t is %zu, so use that in all three
cases.

Fixes: 785e5c61 ("crypto: mediatek - Add crypto driver support for some MediaTek chips")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 7dee9f61
...@@ -221,7 +221,7 @@ static int mtk_aes_info_map(struct mtk_cryp *cryp, ...@@ -221,7 +221,7 @@ static int mtk_aes_info_map(struct mtk_cryp *cryp,
aes->ct_dma = dma_map_single(cryp->dev, info, sizeof(*info), aes->ct_dma = dma_map_single(cryp->dev, info, sizeof(*info),
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(cryp->dev, aes->ct_dma))) { if (unlikely(dma_mapping_error(cryp->dev, aes->ct_dma))) {
dev_err(cryp->dev, "dma %d bytes error\n", sizeof(*info)); dev_err(cryp->dev, "dma %zu bytes error\n", sizeof(*info));
return -EINVAL; return -EINVAL;
} }
aes->tfm_dma = aes->ct_dma + sizeof(*ct); aes->tfm_dma = aes->ct_dma + sizeof(*ct);
......
...@@ -341,7 +341,7 @@ static int mtk_sha_info_map(struct mtk_cryp *cryp, ...@@ -341,7 +341,7 @@ static int mtk_sha_info_map(struct mtk_cryp *cryp,
sha->ct_dma = dma_map_single(cryp->dev, info, sizeof(*info), sha->ct_dma = dma_map_single(cryp->dev, info, sizeof(*info),
DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL);
if (unlikely(dma_mapping_error(cryp->dev, sha->ct_dma))) { if (unlikely(dma_mapping_error(cryp->dev, sha->ct_dma))) {
dev_err(cryp->dev, "dma %d bytes error\n", sizeof(*info)); dev_err(cryp->dev, "dma %zu bytes error\n", sizeof(*info));
return -EINVAL; return -EINVAL;
} }
sha->tfm_dma = sha->ct_dma + sizeof(*ct); sha->tfm_dma = sha->ct_dma + sizeof(*ct);
...@@ -547,7 +547,7 @@ static int mtk_sha_update_slow(struct mtk_cryp *cryp, ...@@ -547,7 +547,7 @@ static int mtk_sha_update_slow(struct mtk_cryp *cryp,
final = (ctx->flags & SHA_FLAGS_FINUP) && !ctx->total; final = (ctx->flags & SHA_FLAGS_FINUP) && !ctx->total;
dev_dbg(cryp->dev, "slow: bufcnt: %u\n", ctx->bufcnt); dev_dbg(cryp->dev, "slow: bufcnt: %zu\n", ctx->bufcnt);
if (final) { if (final) {
sha->flags |= SHA_FLAGS_FINAL; sha->flags |= SHA_FLAGS_FINAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment