* [PATCH] crypto: tcrypt - removed unused variable.
@ 2013-01-16 5:48 Vakul Garg
2013-02-27 16:07 ` Horia Geantă
0 siblings, 1 reply; 2+ messages in thread
From: Vakul Garg @ 2013-01-16 5:48 UTC (permalink / raw)
To: linux-crypto
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().
Signed-off-by: Vakul Garg <vakul@freescale.com>
---
crypto/tcrypt.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 7ae2130..1414b9f 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -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);
--
1.7.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: tcrypt - removed unused variable.
2013-01-16 5:48 [PATCH] crypto: tcrypt - removed unused variable Vakul Garg
@ 2013-02-27 16:07 ` Horia Geantă
0 siblings, 0 replies; 2+ messages in thread
From: Horia Geantă @ 2013-02-27 16:07 UTC (permalink / raw)
To: Vakul Garg; +Cc: linux-crypto
On 1/16/2013 7:48 AM, Vakul Garg wrote:
> 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().
>
> Signed-off-by: Vakul Garg <vakul@freescale.com>
> ---
> @@ -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++) {
You should also remove the deprecated comment in test_ahash_jiffies:
/* we assume there is enough space in 'out' for the result */
Regards,
Horia
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-27 16:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 5:48 [PATCH] crypto: tcrypt - removed unused variable Vakul Garg
2013-02-27 16:07 ` Horia Geantă
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).