Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Fabio Estevam and committed by
Herbert Xu
2326828e bfad6cb3

+6 -6
+6 -6
drivers/crypto/mxc-scc.c
··· 178 178 else 179 179 from = scc->black_memory; 180 180 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, 182 182 ctx->dst_nents * 8); 183 183 len = sg_pcopy_from_buffer(ablkreq->dst, ctx->dst_nents, 184 184 from, ctx->size, ctx->offset); 185 185 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); 187 187 return -EINVAL; 188 188 } 189 189 ··· 274 274 len = sg_pcopy_to_buffer(req->src, ctx->src_nents, 275 275 to, len, ctx->offset); 276 276 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); 278 278 return -EINVAL; 279 279 } 280 280 ··· 335 335 return; 336 336 } 337 337 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)); 341 341 342 342 /* clear interrupt control registers */ 343 343 writel(SCC_SCM_INTR_CTRL_CLR_INTR,