Commit f83f5b12 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Herbert Xu

crypto: tcrypt - Fix mixing printk/pr_err and obvious indentation issues

The recently added test_mb_ahash_speed() has clearly serious coding
style issues. Try to fix some of them:
1. Don't mix pr_err() and printk();
2. Don't wrap strings;
3. Properly align goto statement in if() block;
4. Align wrapped arguments on new line;
5. Don't wrap functions on first argument;
Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 14009c4b
...@@ -608,8 +608,8 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, ...@@ -608,8 +608,8 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec,
req[i] = ahash_request_alloc(tfm, GFP_KERNEL); req[i] = ahash_request_alloc(tfm, GFP_KERNEL);
if (!req[i]) { if (!req[i]) {
printk(KERN_ERR "alg: hash: Failed to allocate " pr_err("alg: hash: Failed to allocate request for %s\n",
"request for %s\n", algo); algo);
goto out_noreq; goto out_noreq;
} }
ahash_request_set_callback(req[i], CRYPTO_TFM_REQ_MAY_BACKLOG, ahash_request_set_callback(req[i], CRYPTO_TFM_REQ_MAY_BACKLOG,
...@@ -621,13 +621,12 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, ...@@ -621,13 +621,12 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec,
j = 0; j = 0;
printk(KERN_INFO "\ntesting speed of %s (%s)\n", algo, pr_err("\ntesting speed of %s (%s)\n", algo,
get_driver_name(crypto_ahash, tfm)); get_driver_name(crypto_ahash, tfm));
for (i = 0; speed[i].blen != 0; i++) { for (i = 0; speed[i].blen != 0; i++) {
if (speed[i].blen > TVMEMSIZE * PAGE_SIZE) { if (speed[i].blen > TVMEMSIZE * PAGE_SIZE) {
printk(KERN_ERR pr_err("template (%u) too big for tvmem (%lu)\n",
"template (%u) too big for tvmem (%lu)\n",
speed[i].blen, TVMEMSIZE * PAGE_SIZE); speed[i].blen, TVMEMSIZE * PAGE_SIZE);
goto out; goto out;
} }
...@@ -642,8 +641,7 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, ...@@ -642,8 +641,7 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec,
result[k], speed[i].blen); result[k], speed[i].blen);
} }
printk(KERN_INFO "test%3u " pr_err("test%3u (%5u byte blocks,%5u bytes per update,%4u updates): ",
"(%5u byte blocks,%5u bytes per update,%4u updates): ",
i, speed[i].blen, speed[i].plen, i, speed[i].blen, speed[i].plen,
speed[i].blen / speed[i].plen); speed[i].blen / speed[i].plen);
...@@ -653,8 +651,7 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, ...@@ -653,8 +651,7 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec,
if (ret == -EBUSY || ret == -EINPROGRESS) if (ret == -EBUSY || ret == -EINPROGRESS)
continue; continue;
if (ret) { if (ret) {
printk(KERN_ERR pr_err("alg (%s) something wrong, ret = %d ...\n",
"alg (%s) something wrong, ret = %d ...\n",
algo, ret); algo, ret);
goto out; goto out;
} }
...@@ -664,11 +661,9 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec, ...@@ -664,11 +661,9 @@ static void test_mb_ahash_speed(const char *algo, unsigned int sec,
for (k = 0; k < 8; ++k) { for (k = 0; k < 8; ++k) {
struct tcrypt_result *tr = &tresult[k]; struct tcrypt_result *tr = &tresult[k];
ret = wait_for_completion_interruptible ret = wait_for_completion_interruptible(&tr->completion);
(&tr->completion);
if (ret) if (ret)
printk(KERN_ERR pr_err("alg(%s): hash: digest failed\n", algo);
"alg(%s): hash: digest failed\n", algo);
end[k] = get_cycles(); end[k] = get_cycles();
} }
......
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