Skip to content

Commit 2326828

Browse files
fabioestevamherbertx
authored andcommitted
crypto: mxc-scc - fix build warnings on ARM64
The following build warnings are seen when building for ARM64 allmodconfig: drivers/crypto/mxc-scc.c:181:20: warning: format '%d' expects argument of type 'int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] drivers/crypto/mxc-scc.c:186:21: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] drivers/crypto/mxc-scc.c:277:21: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] drivers/crypto/mxc-scc.c:339:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] drivers/crypto/mxc-scc.c:340:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Fix them by using the %zu specifier to print a size_t variable and using a plain %x to print the result of a readl(). Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent bfad6cb commit 2326828

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/crypto/mxc-scc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ static int mxc_scc_get_data(struct mxc_scc_ctx *ctx,
178178
else
179179
from = scc->black_memory;
180180

181-
dev_dbg(scc->dev, "pcopy: from 0x%p %d bytes\n", from,
181+
dev_dbg(scc->dev, "pcopy: from 0x%p %zu bytes\n", from,
182182
ctx->dst_nents * 8);
183183
len = sg_pcopy_from_buffer(ablkreq->dst, ctx->dst_nents,
184184
from, ctx->size, ctx->offset);
185185
if (!len) {
186-
dev_err(scc->dev, "pcopy err from 0x%p (len=%d)\n", from, len);
186+
dev_err(scc->dev, "pcopy err from 0x%p (len=%zu)\n", from, len);
187187
return -EINVAL;
188188
}
189189

@@ -274,7 +274,7 @@ static int mxc_scc_put_data(struct mxc_scc_ctx *ctx,
274274
len = sg_pcopy_to_buffer(req->src, ctx->src_nents,
275275
to, len, ctx->offset);
276276
if (!len) {
277-
dev_err(scc->dev, "pcopy err to 0x%p (len=%d)\n", to, len);
277+
dev_err(scc->dev, "pcopy err to 0x%p (len=%zu)\n", to, len);
278278
return -EINVAL;
279279
}
280280

@@ -335,9 +335,9 @@ static void mxc_scc_ablkcipher_next(struct mxc_scc_ctx *ctx,
335335
return;
336336
}
337337

338-
dev_dbg(scc->dev, "Start encryption (0x%p/0x%p)\n",
339-
(void *)readl(scc->base + SCC_SCM_RED_START),
340-
(void *)readl(scc->base + SCC_SCM_BLACK_START));
338+
dev_dbg(scc->dev, "Start encryption (0x%x/0x%x)\n",
339+
readl(scc->base + SCC_SCM_RED_START),
340+
readl(scc->base + SCC_SCM_BLACK_START));
341341

342342
/* clear interrupt control registers */
343343
writel(SCC_SCM_INTR_CTRL_CLR_INTR,

0 commit comments

Comments
 (0)