Commit 837a99f5 authored by Anirudh Venkataramanan's avatar Anirudh Venkataramanan Committed by Herbert Xu

crypto: tcrypt - Use pr_info/pr_err

Currently, there's mixed use of printk() and pr_info()/pr_err(). The latter
prints the module name (because pr_fmt() is defined so) but the former does
not. As a result there's inconsistency in the printed output. For example:

modprobe mode=211:

[...] test 0 (160 bit key, 16 byte blocks): 1 operation in 2320 cycles (16 bytes)
[...] test 1 (160 bit key, 64 byte blocks): 1 operation in 2336 cycles (64 bytes)

modprobe mode=215:

[...] tcrypt: test 0 (160 bit key, 16 byte blocks): 1 operation in 2173 cycles (16 bytes)
[...] tcrypt: test 1 (160 bit key, 64 byte blocks): 1 operation in 2241 cycles (64 bytes)

Replace all instances of printk() with pr_info()/pr_err() so that the
module name is printed consistently.
Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fdaeb224
...@@ -575,8 +575,8 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs, ...@@ -575,8 +575,8 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
} }
crypto_init_wait(&wait); crypto_init_wait(&wait);
printk(KERN_INFO "\ntesting speed of %s (%s) %s\n", algo, pr_info("\ntesting speed of %s (%s) %s\n", algo,
get_driver_name(crypto_aead, tfm), e); get_driver_name(crypto_aead, tfm), e);
req = aead_request_alloc(tfm, GFP_KERNEL); req = aead_request_alloc(tfm, GFP_KERNEL);
if (!req) { if (!req) {
...@@ -624,8 +624,8 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs, ...@@ -624,8 +624,8 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
memset(iv, 0xff, iv_len); memset(iv, 0xff, iv_len);
crypto_aead_clear_flags(tfm, ~0); crypto_aead_clear_flags(tfm, ~0);
printk(KERN_INFO "test %u (%d bit key, %d byte blocks): ", pr_info("test %u (%d bit key, %d byte blocks): ",
i, *keysize * 8, bs); i, *keysize * 8, bs);
memset(tvmem[0], 0xff, PAGE_SIZE); memset(tvmem[0], 0xff, PAGE_SIZE);
...@@ -877,8 +877,8 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs, ...@@ -877,8 +877,8 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs,
return; return;
} }
printk(KERN_INFO "\ntesting speed of async %s (%s)\n", algo, pr_info("\ntesting speed of async %s (%s)\n", algo,
get_driver_name(crypto_ahash, tfm)); get_driver_name(crypto_ahash, tfm));
if (crypto_ahash_digestsize(tfm) > MAX_DIGEST_SIZE) { if (crypto_ahash_digestsize(tfm) > MAX_DIGEST_SIZE) {
pr_err("digestsize(%u) > %d\n", crypto_ahash_digestsize(tfm), pr_err("digestsize(%u) > %d\n", crypto_ahash_digestsize(tfm),
...@@ -2885,7 +2885,7 @@ static int __init tcrypt_mod_init(void) ...@@ -2885,7 +2885,7 @@ static int __init tcrypt_mod_init(void)
err = do_test(alg, type, mask, mode, num_mb); err = do_test(alg, type, mask, mode, num_mb);
if (err) { if (err) {
printk(KERN_ERR "tcrypt: one or more tests failed!\n"); pr_err("one or more tests failed!\n");
goto err_free_tv; goto err_free_tv;
} else { } else {
pr_debug("all tests passed\n"); pr_debug("all tests passed\n");
......
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