summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoria Geantă <horia.geanta@freescale.com>2015-05-29 07:22:07 (GMT)
committerHonghua Yin <Hong-Hua.Yin@freescale.com>2015-06-01 06:42:27 (GMT)
commit6dfc79b030b4ea1d34e65eb75f25161e3038b134 (patch)
tree0366cd15603c426e419e0525c06afe1886274133
parentf32970246cb5547c18e421273c5f8b1e2f7e7b66 (diff)
downloadlinux-fsl-qoriq-6dfc79b030b4ea1d34e65eb75f25161e3038b134.tar.xz
crypto: caam - fix size_t print format
ARRAY_SIZE() returns a size_t value. Thus, when printing these values, %zu or %zx must be used, or else warnings show up: CC drivers/crypto/caam//caamalg.o In file included from include/linux/thread_info.h:11:0, from include/linux/preempt.h:9, from include/linux/spinlock.h:50, from include/linux/seqlock.h:35, from include/linux/time.h:5, from include/linux/stat.h:18, from include/linux/module.h:10, from drivers/crypto/caam//compat.h:9, from drivers/crypto/caam//caamalg.c:47: drivers/crypto/caam//caamalg.c: In function 'caam_cra_init': include/linux/bug.h:33:45: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=] #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) ^ include/linux/compiler-gcc.h:47:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO' #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) ^ include/linux/kernel.h:41:59: note: in expansion of macro '__must_be_array' #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) ^ drivers/crypto/caam//caamalg.c:4396:13: note: in expansion of macro 'ARRAY_SIZE' op_id, ARRAY_SIZE(digest_size)); ^ CC drivers/crypto/caam//caamhash.o In file included from include/linux/thread_info.h:11:0, from include/linux/preempt.h:9, from include/linux/spinlock.h:50, from include/linux/seqlock.h:35, from include/linux/time.h:5, from include/linux/stat.h:18, from include/linux/module.h:10, from drivers/crypto/caam//compat.h:9, from drivers/crypto/caam//caamhash.c:56: drivers/crypto/caam//caamhash.c: In function 'caam_hash_cra_init': include/linux/bug.h:33:45: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=] #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) ^ include/linux/compiler-gcc.h:47:28: note: in expansion of macro 'BUILD_BUG_ON_ZERO' #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) ^ include/linux/kernel.h:41:59: note: in expansion of macro '__must_be_array' #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) ^ drivers/crypto/caam//caamhash.c:1782:12: note: in expansion of macro 'ARRAY_SIZE' op_id, ARRAY_SIZE(runninglen)); ^ Signed-off-by: Horia Geantă <horia.geanta@freescale.com> Change-Id: Ica005a337d654f7d55eea6f5e5aee911cbd016b2 Reviewed-on: http://git.am.freescale.net:8181/37071 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Tudor-Dan Ambarus <tudor.ambarus@freescale.com> Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
-rw-r--r--drivers/crypto/caam/caamalg.c2
-rw-r--r--drivers/crypto/caam/caamhash.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index ea44991..0f117d0 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -4392,7 +4392,7 @@ static int caam_cra_init(struct crypto_tfm *tfm)
if (op_id < ARRAY_SIZE(digest_size)) {
ctx->authsize = digest_size[op_id];
} else {
- dev_err(ctx->jrdev, "incorrect op_id %d; must be less than %d\n",
+ dev_err(ctx->jrdev, "incorrect op_id %d; must be less than %zu\n",
op_id, ARRAY_SIZE(digest_size));
caam_jr_free(ctx->jrdev);
return -EINVAL;
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index 697a683..e99a45b 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -1778,7 +1778,7 @@ static int caam_hash_cra_init(struct crypto_tfm *tfm)
op_id = (ctx->alg_op & OP_ALG_ALGSEL_SUBMASK) >> OP_ALG_ALGSEL_SHIFT;
if (op_id >= ARRAY_SIZE(runninglen)) {
- dev_err(ctx->jrdev, "incorrect op_id %d; must be less than %d\n",
+ dev_err(ctx->jrdev, "incorrect op_id %d; must be less than %zu\n",
op_id, ARRAY_SIZE(runninglen));
ret = -EINVAL;
goto out_err;