crypto: caam - print messages in caam_dump_sg at debug level

caam_dump_sg() is only compiled in when DEBUG is defined, hence the
messages are debug messages. Remove the @level argument from
caam_dump_sg() and print all messages at debug level.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Sascha Hauer 2019-05-23 10:50:30 +02:00 committed by Herbert Xu
parent 6e00550319
commit 8a82451bd0
5 changed files with 12 additions and 12 deletions

View File

@ -1001,7 +1001,7 @@ static void skcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err,
DUMP_PREFIX_ADDRESS, 16, 4, req->iv, DUMP_PREFIX_ADDRESS, 16, 4, req->iv,
edesc->src_nents > 1 ? 100 : ivsize, 1); edesc->src_nents > 1 ? 100 : ivsize, 1);
caam_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", caam_dump_sg("dst @" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->dst, DUMP_PREFIX_ADDRESS, 16, 4, req->dst,
edesc->dst_nents > 1 ? 100 : req->cryptlen, 1); edesc->dst_nents > 1 ? 100 : req->cryptlen, 1);
@ -1028,7 +1028,7 @@ static void skcipher_decrypt_done(struct device *jrdev, u32 *desc, u32 err,
print_hex_dump_debug("dstiv @"__stringify(__LINE__)": ", print_hex_dump_debug("dstiv @"__stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->iv, ivsize, 1); DUMP_PREFIX_ADDRESS, 16, 4, req->iv, ivsize, 1);
caam_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", caam_dump_sg("dst @" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->dst, DUMP_PREFIX_ADDRESS, 16, 4, req->dst,
edesc->dst_nents > 1 ? 100 : req->cryptlen, 1); edesc->dst_nents > 1 ? 100 : req->cryptlen, 1);
@ -1236,7 +1236,7 @@ static void init_skcipher_job(struct skcipher_request *req,
dev_dbg(jrdev, "asked=%d, cryptlen%d\n", dev_dbg(jrdev, "asked=%d, cryptlen%d\n",
(int)edesc->src_nents > 1 ? 100 : req->cryptlen, req->cryptlen); (int)edesc->src_nents > 1 ? 100 : req->cryptlen, req->cryptlen);
caam_dump_sg(KERN_ERR, "src @" __stringify(__LINE__)": ", caam_dump_sg("src @" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->src, DUMP_PREFIX_ADDRESS, 16, 4, req->src,
edesc->src_nents > 1 ? 100 : req->cryptlen, 1); edesc->src_nents > 1 ? 100 : req->cryptlen, 1);
@ -1606,7 +1606,7 @@ static int aead_decrypt(struct aead_request *req)
u32 *desc; u32 *desc;
int ret = 0; int ret = 0;
caam_dump_sg(KERN_ERR, "dec src@" __stringify(__LINE__)": ", caam_dump_sg("dec src@" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->src, DUMP_PREFIX_ADDRESS, 16, 4, req->src,
req->assoclen + req->cryptlen, 1); req->assoclen + req->cryptlen, 1);

View File

@ -1200,7 +1200,7 @@ static void skcipher_done(struct caam_drv_req *drv_req, u32 status)
print_hex_dump_debug("dstiv @" __stringify(__LINE__)": ", print_hex_dump_debug("dstiv @" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->iv, DUMP_PREFIX_ADDRESS, 16, 4, req->iv,
edesc->src_nents > 1 ? 100 : ivsize, 1); edesc->src_nents > 1 ? 100 : ivsize, 1);
caam_dump_sg(KERN_ERR, "dst @" __stringify(__LINE__)": ", caam_dump_sg("dst @" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->dst, DUMP_PREFIX_ADDRESS, 16, 4, req->dst,
edesc->dst_nents > 1 ? 100 : req->cryptlen, 1); edesc->dst_nents > 1 ? 100 : req->cryptlen, 1);

View File

@ -1366,7 +1366,7 @@ static void skcipher_encrypt_done(void *cbk_ctx, u32 status)
print_hex_dump_debug("dstiv @" __stringify(__LINE__)": ", print_hex_dump_debug("dstiv @" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->iv, DUMP_PREFIX_ADDRESS, 16, 4, req->iv,
edesc->src_nents > 1 ? 100 : ivsize, 1); edesc->src_nents > 1 ? 100 : ivsize, 1);
caam_dump_sg(KERN_DEBUG, "dst @" __stringify(__LINE__)": ", caam_dump_sg("dst @" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->dst, DUMP_PREFIX_ADDRESS, 16, 4, req->dst,
edesc->dst_nents > 1 ? 100 : req->cryptlen, 1); edesc->dst_nents > 1 ? 100 : req->cryptlen, 1);
@ -1404,7 +1404,7 @@ static void skcipher_decrypt_done(void *cbk_ctx, u32 status)
print_hex_dump_debug("dstiv @" __stringify(__LINE__)": ", print_hex_dump_debug("dstiv @" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->iv, DUMP_PREFIX_ADDRESS, 16, 4, req->iv,
edesc->src_nents > 1 ? 100 : ivsize, 1); edesc->src_nents > 1 ? 100 : ivsize, 1);
caam_dump_sg(KERN_DEBUG, "dst @" __stringify(__LINE__)": ", caam_dump_sg("dst @" __stringify(__LINE__)": ",
DUMP_PREFIX_ADDRESS, 16, 4, req->dst, DUMP_PREFIX_ADDRESS, 16, 4, req->dst,
edesc->dst_nents > 1 ? 100 : req->cryptlen, 1); edesc->dst_nents > 1 ? 100 : req->cryptlen, 1);

View File

@ -13,7 +13,7 @@
#ifdef DEBUG #ifdef DEBUG
#include <linux/highmem.h> #include <linux/highmem.h>
void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type, void caam_dump_sg(const char *prefix_str, int prefix_type,
int rowsize, int groupsize, struct scatterlist *sg, int rowsize, int groupsize, struct scatterlist *sg,
size_t tlen, bool ascii) size_t tlen, bool ascii)
{ {
@ -35,15 +35,15 @@ void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type,
buf = it_page + it->offset; buf = it_page + it->offset;
len = min_t(size_t, tlen, it->length); len = min_t(size_t, tlen, it->length);
print_hex_dump(level, prefix_str, prefix_type, rowsize, print_hex_dump_debug(prefix_str, prefix_type, rowsize,
groupsize, buf, len, ascii); groupsize, buf, len, ascii);
tlen -= len; tlen -= len;
kunmap_atomic(it_page); kunmap_atomic(it_page);
} }
} }
#else #else
void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type, void caam_dump_sg(const char *prefix_str, int prefix_type,
int rowsize, int groupsize, struct scatterlist *sg, int rowsize, int groupsize, struct scatterlist *sg,
size_t tlen, bool ascii) size_t tlen, bool ascii)
{} {}

View File

@ -17,7 +17,7 @@ void caam_strstatus(struct device *dev, u32 status, bool qi_v2);
#define caam_jr_strstatus(jrdev, status) caam_strstatus(jrdev, status, false) #define caam_jr_strstatus(jrdev, status) caam_strstatus(jrdev, status, false)
#define caam_qi2_strstatus(qidev, status) caam_strstatus(qidev, status, true) #define caam_qi2_strstatus(qidev, status) caam_strstatus(qidev, status, true)
void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type, void caam_dump_sg(const char *prefix_str, int prefix_type,
int rowsize, int groupsize, struct scatterlist *sg, int rowsize, int groupsize, struct scatterlist *sg,
size_t tlen, bool ascii); size_t tlen, bool ascii);