crypto: tcrypt - removed unused variable.
PATCH 1/1 crypto: tcrypt - removed unused variable.
Removed unused variable for storing output string from:
(a) test_ahash_jiffies_digest() (b) test_ahash_jiffies() (c) test_ahash_cycles_digest() (d) test_ahash_cycles()
This variable is not needed in above functions since the caller function test_ahash_speed() already sets output buffer in the ahash transform using ahash_request_set_crypt().
--- crypto/tcrypt.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-)
crypto/tcrypt.c +8 -9
@@ -499,7 +499,7 @@ static inline int do_one_ahash_op(struct ahash_request *req, int ret) }static int test_ahash_jiffies_digest (struct ahash_request *req,int blen, -char *out,int sec) +int sec) {unsigned long start, end;int bcount;
@@ -519,14 +519,14 @@ static int test_ahash_jiffies_digest(struct ahash_request *req, int blen, }static int test_ahash_jiffies (struct ahash_request *req,int blen, -int plen,char *out,int sec) +int plen,int sec) {unsigned long start, end;int bcount, pcount;int ret;if (plen == blen) -return test_ahash_jiffies_digest (req, blen, out, sec); +return test_ahash_jiffies_digest (req, blen, sec);for (start = jiffies, end = start + sec *HZ , bcount =0 ;time_before (jiffies, end); bcount++) {
@@ -550,8 +550,7 @@ static int test_ahash_jiffies(struct ahash_request *req, int blen,return 0 ; } -static int test_ahash_cycles_digest (struct ahash_request *req,int blen, -char *out) +static int test_ahash_cycles_digest (struct ahash_request *req,int blen) {unsigned long cycles =0 ;int ret, i;
@@ -589,13 +588,13 @@ out: }static int test_ahash_cycles (struct ahash_request *req,int blen, -int plen,char *out) +int plen) {unsigned long cycles =0 ;int i, pcount, ret;if (plen == blen) -return test_ahash_cycles_digest (req, blen, out); +return test_ahash_cycles_digest (req, blen);/* Warm-up run. */ for (i =0 ; i <4 ; i++) {
@@ -696,10 +695,10 @@ static void test_ahash_speed(const char *algo, unsigned int sec,if (sec) ret =test_ahash_jiffies (req, speed[i].blen, - speed[i].plen, output, sec); + speed[i].plen, sec);else ret =test_ahash_cycles (req, speed[i].blen, - speed[i].plen, output); + speed[i].plen);if (ret) {pr_err ("hashing failed ret=%d\n" , ret);
Signature · 1 line
1.7.7
Quoted 21 lines · Vakul Garg
Removed unused variable for storing output string from:
(a) test_ahash_jiffies_digest() (b) test_ahash_jiffies() (c) test_ahash_cycles_digest() (d) test_ahash_cycles()This variable is not needed in above functions since the caller function
test_ahash_speed()already sets output buffer in the ahash transform usingahash_request_set_crypt().Signed-off-by Vakul Garg <[email protected]>---
crypto/tcrypt.c +1
-1@@ -519,14 +519,14 @@ static int test_ahash_jiffies_digest(struct ahash_request *req, int blen, }static int test_ahash_jiffies (struct ahash_request *req,int blen, -int plen,char *out,int sec) +int plen,int sec) {
crypto/tcrypt.c static int test_ahash_jiffies_digest(struct ahash_request *req, int blen, · line 532
Quoted 10 lines
crypto/tcrypt.c +1
-1unsigned long start, end;int bcount, pcount;int ret;if (plen == blen) -return test_ahash_jiffies_digest (req, blen, out, sec); +return test_ahash_jiffies_digest (req, blen, sec);for (start = jiffies, end = start + sec *HZ , bcount =0 ;time_before (jiffies, end); bcount++) {
You should also remove the deprecated comment in test_ahash_jiffies:
/* we assume there is enough space in 'out' for the result */
Regards,
Horia