Re: [PATCHv3][trivial] crypto: tcrypt - reduce stack size

2009-03-29 Thread Herbert Xu
On Wed, Feb 25, 2009 at 10:32:31AM -0500, Neil Horman wrote:
 On Wed, Feb 25, 2009 at 03:53:14PM +0100, Frank Seidel wrote:
  From: Frank Seidel fr...@f-seidel.de
  
  Applying kernel janitors todos (printk calls need KERN_*
  constants on linebeginnings, reduce stack footprint where
  possible) to tcrypts test_hash_speed (where stacks
  memory footprint was very high (on i386 1184 bytes to
  160 now).
  
  Signed-off-by: Frank Seidel fr...@f-seidel.de
 Looks good, thanks Frank
 Acked-by: Neil Horman nhor...@tuxdriver.com

Patch applied to cryptodev.  Thanks!
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} herb...@gondor.apana.org.au
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3][trivial] crypto: tcrypt - reduce stack size

2009-02-25 Thread Frank Seidel
From: Frank Seidel fr...@f-seidel.de

Applying kernel janitors todos (printk calls need KERN_*
constants on linebeginnings, reduce stack footprint where
possible) to tcrypts test_hash_speed (where stacks
memory footprint was very high (on i386 1184 bytes to
160 now).

Signed-off-by: Frank Seidel fr...@f-seidel.de
---
 crypto/tcrypt.c |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -396,16 +396,16 @@ static void test_hash_speed(const char *
struct scatterlist sg[TVMEMSIZE];
struct crypto_hash *tfm;
struct hash_desc desc;
-   char output[1024];
+   static char output[1024];
int i;
int ret;
 
-   printk(\ntesting speed of %s\n, algo);
+   printk(KERN_INFO \ntesting speed of %s\n, algo);
 
tfm = crypto_alloc_hash(algo, 0, CRYPTO_ALG_ASYNC);
 
if (IS_ERR(tfm)) {
-   printk(failed to load transform for %s: %ld\n, algo,
+   printk(KERN_ERR failed to load transform for %s: %ld\n, algo,
   PTR_ERR(tfm));
return;
}
@@ -414,7 +414,7 @@ static void test_hash_speed(const char *
desc.flags = 0;
 
if (crypto_hash_digestsize(tfm)  sizeof(output)) {
-   printk(digestsize(%u)  outputbuffer(%zu)\n,
+   printk(KERN_ERR digestsize(%u)  outputbuffer(%zu)\n,
   crypto_hash_digestsize(tfm), sizeof(output));
goto out;
}
@@ -427,12 +427,14 @@ static void test_hash_speed(const char *
 
for (i = 0; speed[i].blen != 0; i++) {
if (speed[i].blen  TVMEMSIZE * PAGE_SIZE) {
-   printk(template (%u) too big for tvmem (%lu)\n,
+   printk(KERN_ERR
+  template (%u) too big for tvmem (%lu)\n,
   speed[i].blen, TVMEMSIZE * PAGE_SIZE);
goto out;
}
 
-   printk(test%3u (%5u byte blocks,%5u bytes per update,%4u 
updates): ,
+   printk(KERN_INFO test%3u 
+  (%5u byte blocks,%5u bytes per update,%4u updates): ,
   i, speed[i].blen, speed[i].plen, speed[i].blen / 
speed[i].plen);
 
if (sec)
@@ -443,7 +445,7 @@ static void test_hash_speed(const char *
   speed[i].plen, output);
 
if (ret) {
-   printk(hashing failed ret=%d\n, ret);
+   printk(KERN_ERR hashing failed ret=%d\n, ret);
break;
}
}
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv3][trivial] crypto: tcrypt - reduce stack size

2009-02-25 Thread Neil Horman
On Wed, Feb 25, 2009 at 03:53:14PM +0100, Frank Seidel wrote:
 From: Frank Seidel fr...@f-seidel.de
 
 Applying kernel janitors todos (printk calls need KERN_*
 constants on linebeginnings, reduce stack footprint where
 possible) to tcrypts test_hash_speed (where stacks
 memory footprint was very high (on i386 1184 bytes to
 160 now).
 
 Signed-off-by: Frank Seidel fr...@f-seidel.de
Looks good, thanks Frank
Acked-by: Neil Horman nhor...@tuxdriver.com

--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv3][trivial] crypto: tcrypt - reduce stack size

2009-02-25 Thread Frank Seidel
Geert Uytterhoeven wrote:
 BTW, why are you using printk(KERN_INFO ...), and not pr_info(...)?

Without special reason. Is pr_info preferred?

Thanks,
Frank
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv3][trivial] crypto: tcrypt - reduce stack size

2009-02-25 Thread Geert Uytterhoeven
On Wed, 25 Feb 2009, Frank Seidel wrote:
 Geert Uytterhoeven wrote:
  BTW, why are you using printk(KERN_INFO ...), and not pr_info(...)?
 
 Without special reason. Is pr_info preferred?

It's shorter.

Especially `pr_err' fits in the space of `printk', so you don't have to split
lines that become to long due to adding the KERN_*.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:+32 (0)2 700 8453
Fax:  +32 (0)2 700 8622
E-mail:   geert.uytterhoe...@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html