linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] crypto test: use print_hex_dump from <linux/kernel.h>
@ 2007-11-26  7:13 Denis Cheng
  2007-11-26 14:39 ` Herbert Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Denis Cheng @ 2007-11-26  7:13 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller; +Cc: linux-crypto, linux-kernel, Randy Dunlap

these utilities implemented in lib/hexdump.c are more handy, please use this.

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 crypto/tcrypt.c |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 24141fb..8766023 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -81,14 +81,6 @@ static char *check[] = {
 	"camellia", "seed", NULL
 };
 
-static void hexdump(unsigned char *buf, unsigned int len)
-{
-	while (len--)
-		printk("%02x", *buf++);
-
-	printk("\n");
-}
-
 static void tcrypt_complete(struct crypto_async_request *req, int err)
 {
 	struct tcrypt_result *res = req->data;
@@ -156,7 +148,8 @@ static void test_hash(char *algo, struct hash_testvec *template,
 			goto out;
 		}
 
-		hexdump(result, crypto_hash_digestsize(tfm));
+		print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, result, crypto_hash_digestsize(tfm), 1);
+
 		printk("%s\n",
 		       memcmp(result, hash_tv[i].digest,
 			      crypto_hash_digestsize(tfm)) ?
@@ -203,7 +196,7 @@ static void test_hash(char *algo, struct hash_testvec *template,
 				goto out;
 			}
 
-			hexdump(result, crypto_hash_digestsize(tfm));
+			print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, result, crypto_hash_digestsize(tfm), 1);
 			printk("%s\n",
 			       memcmp(result, hash_tv[i].digest,
 				      crypto_hash_digestsize(tfm)) ?
@@ -319,7 +312,7 @@ static void test_cipher(char *algo, int enc,
 			}
 
 			q = kmap(sg_page(&sg[0])) + sg[0].offset;
-			hexdump(q, cipher_tv[i].rlen);
+			print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, q, cipher_tv[i].rlen, 1);
 
 			printk("%s\n",
 			       memcmp(q, cipher_tv[i].result,
@@ -393,7 +386,7 @@ static void test_cipher(char *algo, int enc,
 			for (k = 0; k < cipher_tv[i].np; k++) {
 				printk("page %u\n", k);
 				q = kmap(sg_page(&sg[k])) + sg[k].offset;
-				hexdump(q, cipher_tv[i].tap[k]);
+				print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, q, cipher_tv[i].tap[k], 1);
 				printk("%s\n",
 					memcmp(q, cipher_tv[i].result + temp,
 						cipher_tv[i].tap[k]) ? "fail" :
@@ -839,7 +832,7 @@ static void test_deflate(void)
 			printk("fail: ret=%d\n", ret);
 			continue;
 		}
-		hexdump(result, dlen);
+		print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, result, dlen, 1);
 		printk("%s (ratio %d:%d)\n",
 		       memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
 		       ilen, dlen);
@@ -870,7 +863,7 @@ static void test_deflate(void)
 			printk("fail: ret=%d\n", ret);
 			continue;
 		}
-		hexdump(result, dlen);
+		print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, result, dlen, 1);
 		printk("%s (ratio %d:%d)\n",
 		       memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
 		       ilen, dlen);
-- 
1.5.3.5


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/2] crypto test: use print_hex_dump from <linux/kernel.h>
  2007-11-26  7:13 [PATCH 1/2] crypto test: use print_hex_dump from <linux/kernel.h> Denis Cheng
@ 2007-11-26 14:39 ` Herbert Xu
  2007-11-26 17:28   ` [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead Denis Cheng
  0 siblings, 1 reply; 13+ messages in thread
From: Herbert Xu @ 2007-11-26 14:39 UTC (permalink / raw)
  To: Denis Cheng; +Cc: David S. Miller, linux-crypto, linux-kernel, Randy Dunlap

On Mon, Nov 26, 2007 at 03:13:02PM +0800, Denis Cheng wrote:
> these utilities implemented in lib/hexdump.c are more handy, please use this.
> 
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: Denis Cheng <crquan@gmail.com>

OK this is pretty nice.  But you just missed out because the
GCM patches that just went in added more hexdump uses :)

So could you please refresh your patch against the latest cryptodev
tree? Please also clamp those long lines to 80 characters.

On an unrelated note, lib/hexdump.c should not print 8-bit text
even though they pass the is_print test.  They just turn up as
crap on Unicode terminals.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead
  2007-11-26 14:39 ` Herbert Xu
@ 2007-11-26 17:28   ` Denis Cheng
  2007-11-26 18:01     ` Joe Perches
  2007-11-27  1:05     ` [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead Herbert Xu
  0 siblings, 2 replies; 13+ messages in thread
From: Denis Cheng @ 2007-11-26 17:28 UTC (permalink / raw)
  To: Herbert Xu, linux-crypto; +Cc: linux-kernel, dengxw, Randy Dunlap

this patch is against cryptodev-2.6, and have passed scripts/checkpatch.pl

KERN_DEBUG is stripped out, this acts more like the original in tcrypto.c

and the last parameter "bool ascii" set to zero to disable ascii output,
this could keep it happy on Unicode terminals.

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 crypto/tcrypt.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 24141fb..665aa87 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -81,14 +81,6 @@ static char *check[] = {
 	"camellia", "seed", NULL
 };
 
-static void hexdump(unsigned char *buf, unsigned int len)
-{
-	while (len--)
-		printk("%02x", *buf++);
-
-	printk("\n");
-}
-
 static void tcrypt_complete(struct crypto_async_request *req, int err)
 {
 	struct tcrypt_result *res = req->data;
@@ -156,7 +148,9 @@ static void test_hash(char *algo, struct hash_testvec *template,
 			goto out;
 		}
 
-		hexdump(result, crypto_hash_digestsize(tfm));
+		print_hex_dump("", "", DUMP_PREFIX_OFFSET, 16, 1,
+				result, crypto_hash_digestsize(tfm), 0);
+
 		printk("%s\n",
 		       memcmp(result, hash_tv[i].digest,
 			      crypto_hash_digestsize(tfm)) ?
@@ -203,7 +197,9 @@ static void test_hash(char *algo, struct hash_testvec *template,
 				goto out;
 			}
 
-			hexdump(result, crypto_hash_digestsize(tfm));
+			print_hex_dump("", "", DUMP_PREFIX_OFFSET,
+					16, 1,
+					result, crypto_hash_digestsize(tfm), 0);
 			printk("%s\n",
 			       memcmp(result, hash_tv[i].digest,
 				      crypto_hash_digestsize(tfm)) ?
@@ -319,7 +315,9 @@ static void test_cipher(char *algo, int enc,
 			}
 
 			q = kmap(sg_page(&sg[0])) + sg[0].offset;
-			hexdump(q, cipher_tv[i].rlen);
+			print_hex_dump("", "", DUMP_PREFIX_OFFSET,
+					16, 1,
+					q, cipher_tv[i].rlen, 0);
 
 			printk("%s\n",
 			       memcmp(q, cipher_tv[i].result,
@@ -393,7 +391,9 @@ static void test_cipher(char *algo, int enc,
 			for (k = 0; k < cipher_tv[i].np; k++) {
 				printk("page %u\n", k);
 				q = kmap(sg_page(&sg[k])) + sg[k].offset;
-				hexdump(q, cipher_tv[i].tap[k]);
+				print_hex_dump("", "", DUMP_PREFIX_OFFSET,
+						16, 1,
+						q, cipher_tv[i].tap[k], 0);
 				printk("%s\n",
 					memcmp(q, cipher_tv[i].result + temp,
 						cipher_tv[i].tap[k]) ? "fail" :
@@ -839,7 +839,8 @@ static void test_deflate(void)
 			printk("fail: ret=%d\n", ret);
 			continue;
 		}
-		hexdump(result, dlen);
+		print_hex_dump("", "", DUMP_PREFIX_OFFSET, 16, 1,
+				result, dlen, 0);
 		printk("%s (ratio %d:%d)\n",
 		       memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
 		       ilen, dlen);
@@ -870,7 +871,8 @@ static void test_deflate(void)
 			printk("fail: ret=%d\n", ret);
 			continue;
 		}
-		hexdump(result, dlen);
+		print_hex_dump("", "", DUMP_PREFIX_OFFSET, 16, 1,
+				result, dlen, 0);
 		printk("%s (ratio %d:%d)\n",
 		       memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
 		       ilen, dlen);
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead
  2007-11-26 17:28   ` [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead Denis Cheng
@ 2007-11-26 18:01     ` Joe Perches
  2007-11-27  1:35       ` Herbert Xu
  2007-11-27  1:05     ` [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead Herbert Xu
  1 sibling, 1 reply; 13+ messages in thread
From: Joe Perches @ 2007-11-26 18:01 UTC (permalink / raw)
  To: Denis Cheng; +Cc: Herbert Xu, linux-crypto, linux-kernel, dengxw, Randy Dunlap

On Tue, 2007-11-27 at 01:28 +0800, Denis Cheng wrote:
> -static void hexdump(unsigned char *buf, unsigned int len)
> -{
> -	while (len--)
> -		printk("%02x", *buf++);
> -
> -	printk("\n");
> -}

#define hexdump(buf, len) \
	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, \
	               (buf), (len), false)

requires no other changes.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead
  2007-11-26 17:28   ` [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead Denis Cheng
  2007-11-26 18:01     ` Joe Perches
@ 2007-11-27  1:05     ` Herbert Xu
  1 sibling, 0 replies; 13+ messages in thread
From: Herbert Xu @ 2007-11-27  1:05 UTC (permalink / raw)
  To: Denis Cheng; +Cc: linux-crypto, linux-kernel, dengxw, Randy Dunlap

On Tue, Nov 27, 2007 at 01:28:15AM +0800, Denis Cheng wrote:
> this patch is against cryptodev-2.6, and have passed scripts/checkpatch.pl
> 
> KERN_DEBUG is stripped out, this acts more like the original in tcrypto.c
> 
> and the last parameter "bool ascii" set to zero to disable ascii output,
> this could keep it happy on Unicode terminals.
> 
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: Denis Cheng <crquan@gmail.com>

Sorry, it still doesn't compile because it doesn't change test_aead.
Perhaps you need to pull cryptodev again?

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead
  2007-11-26 18:01     ` Joe Perches
@ 2007-11-27  1:35       ` Herbert Xu
  2007-11-27  2:47         ` [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead Denis Cheng
  0 siblings, 1 reply; 13+ messages in thread
From: Herbert Xu @ 2007-11-27  1:35 UTC (permalink / raw)
  To: Joe Perches; +Cc: Denis Cheng, linux-crypto, linux-kernel, dengxw, Randy Dunlap

On Mon, Nov 26, 2007 at 10:01:44AM -0800, Joe Perches wrote:
> On Tue, 2007-11-27 at 01:28 +0800, Denis Cheng wrote:
> > -static void hexdump(unsigned char *buf, unsigned int len)
> > -{
> > -	while (len--)
> > -		printk("%02x", *buf++);
> > -
> > -	printk("\n");
> > -}
> 
> #define hexdump(buf, len) \
> 	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, \
> 	               (buf), (len), false)
> 
> requires no other changes.

Yes that's a good idea.  Denis could you do another patch with
this, preferably as a static inline function? That way you don't
even need to worry about test_aead.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead
  2007-11-27  1:35       ` Herbert Xu
@ 2007-11-27  2:47         ` Denis Cheng
  2007-11-27  2:58           ` Richard Knutsson
  0 siblings, 1 reply; 13+ messages in thread
From: Denis Cheng @ 2007-11-27  2:47 UTC (permalink / raw)
  To: Herbert Xu, linux-crypto; +Cc: linux-kernel, dengxw, Randy Dunlap, Joe Perches

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Denis Cheng <crquan@gmail.com>
---
this is against the lastest cryptodev tree.

 crypto/tcrypt.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 1e12b86..ae762c2 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -87,12 +87,11 @@ static char *check[] = {
 	"camellia", "seed", "salsa20", NULL
 };
 
-static void hexdump(unsigned char *buf, unsigned int len)
+static inline void hexdump(unsigned char *buf, unsigned int len)
 {
-	while (len--)
-		printk("%02x", *buf++);
-
-	printk("\n");
+	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
+			16, 1,
+			buf, len, 0);
 }
 
 static void tcrypt_complete(struct crypto_async_request *req, int err)
-- 
1.5.3.5


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead
  2007-11-27  2:47         ` [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead Denis Cheng
@ 2007-11-27  2:58           ` Richard Knutsson
  2007-11-27  5:03             ` rae l
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Knutsson @ 2007-11-27  2:58 UTC (permalink / raw)
  To: Denis Cheng
  Cc: Herbert Xu, linux-crypto, linux-kernel, dengxw, Randy Dunlap,
	Joe Perches

Denis Cheng wrote:
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: Denis Cheng <crquan@gmail.com>
> ---
> this is against the lastest cryptodev tree.
>
>  crypto/tcrypt.c |    9 ++++-----
>  1 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
> index 1e12b86..ae762c2 100644
> --- a/crypto/tcrypt.c
> +++ b/crypto/tcrypt.c
> @@ -87,12 +87,11 @@ static char *check[] = {
>  	"camellia", "seed", "salsa20", NULL
>  };
>  
> -static void hexdump(unsigned char *buf, unsigned int len)
> +static inline void hexdump(unsigned char *buf, unsigned int len)
>  {
> -	while (len--)
> -		printk("%02x", *buf++);
> -
> -	printk("\n");
> +	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
> +			16, 1,
> +			buf, len, 0);
>   
Not important, but why use '0' instead of 'false'?
>  }
>  
>  static void tcrypt_complete(struct crypto_async_request *req, int err)
>   
cu
Richard Knutsson


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead
  2007-11-27  2:58           ` Richard Knutsson
@ 2007-11-27  5:03             ` rae l
  2007-11-27  9:26               ` Andrew Morton
  0 siblings, 1 reply; 13+ messages in thread
From: rae l @ 2007-11-27  5:03 UTC (permalink / raw)
  To: Richard Knutsson
  Cc: Herbert Xu, linux-crypto, linux-kernel, dengxw, Randy Dunlap,
	Joe Perches

On Nov 27, 2007 10:58 AM, Richard Knutsson <ricknu-0@student.ltu.se> wrote:
...
> > +     print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
> > +                     16, 1,
> > +                     buf, len, 0);
> >
> Not important, but why use '0' instead of 'false'?
after read http://lkml.org/lkml/2006/7/27/281, I agreed with you.
this is refreshed patch against the lastest cryptodev tree.

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 crypto/tcrypt.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 1e12b86..ae762c2 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -87,12 +87,11 @@ static char *check[] = {
 	"camellia", "seed", "salsa20", NULL
 };

-static void hexdump(unsigned char *buf, unsigned int len)
+static inline void hexdump(unsigned char *buf, unsigned int len)
 {
-	while (len--)
-		printk("%02x", *buf++);
-
-	printk("\n");
+	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
+			16, 1,
+			buf, len, false);
 }

 static void tcrypt_complete(struct crypto_async_request *req, int err)

-- 
Denis Cheng

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead
  2007-11-27  5:03             ` rae l
@ 2007-11-27  9:26               ` Andrew Morton
  2007-11-29 11:13                 ` Herbert Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Morton @ 2007-11-27  9:26 UTC (permalink / raw)
  To: rae l
  Cc: Richard Knutsson, Herbert Xu, linux-crypto, linux-kernel, dengxw,
	Randy Dunlap, Joe Perches

On Tue, 27 Nov 2007 13:03:29 +0800 "rae l" <crquan@gmail.com> wrote:

> -static void hexdump(unsigned char *buf, unsigned int len)
> +static inline void hexdump(unsigned char *buf, unsigned int len)
>  {
> -	while (len--)
> -		printk("%02x", *buf++);
> -
> -	printk("\n");
> +	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
> +			16, 1,
> +			buf, len, false);
>  }

uninlining this function shrinks crypto/tcrypt.o's .text from 20,009 bytes
down to 19,701.

inlining is almost always wrong.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead
  2007-11-27  9:26               ` Andrew Morton
@ 2007-11-29 11:13                 ` Herbert Xu
  2007-11-30  1:20                   ` rae l
  0 siblings, 1 reply; 13+ messages in thread
From: Herbert Xu @ 2007-11-29 11:13 UTC (permalink / raw)
  To: Andrew Morton
  Cc: rae l, Richard Knutsson, linux-crypto, linux-kernel, dengxw,
	Randy Dunlap, Joe Perches

On Tue, Nov 27, 2007 at 01:26:22AM -0800, Andrew Morton wrote:
> On Tue, 27 Nov 2007 13:03:29 +0800 "rae l" <crquan@gmail.com> wrote:
> 
> > -static void hexdump(unsigned char *buf, unsigned int len)
> > +static inline void hexdump(unsigned char *buf, unsigned int len)
> >  {
> > -	while (len--)
> > -		printk("%02x", *buf++);
> > -
> > -	printk("\n");
> > +	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
> > +			16, 1,
> > +			buf, len, false);
> >  }
> 
> uninlining this function shrinks crypto/tcrypt.o's .text from 20,009 bytes
> down to 19,701.
> 
> inlining is almost always wrong.

I agree.  Please do as Andrew suggests and resubmit.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead
  2007-11-29 11:13                 ` Herbert Xu
@ 2007-11-30  1:20                   ` rae l
  2007-11-30  6:00                     ` Herbert Xu
  0 siblings, 1 reply; 13+ messages in thread
From: rae l @ 2007-11-30  1:20 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Andrew Morton, Richard Knutsson, linux-crypto, linux-kernel,
	dengxw, Randy Dunlap, Joe Perches

On Nov 29, 2007 7:13 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
...
> > uninlining this function shrinks crypto/tcrypt.o's .text from 20,009 bytes
> > down to 19,701.
> >
> > inlining is almost always wrong.
>
> I agree.  Please do as Andrew suggests and resubmit.
inline disabled.

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Denis Cheng <crquan@gmail.com>
---

diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 24141fb..13efc72 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -83,10 +83,9 @@ static char *check[] = {

 static void hexdump(unsigned char *buf, unsigned int len)
 {
-	while (len--)
-		printk("%02x", *buf++);
-
-	printk("\n");
+	print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
+			16, 1,
+			buf, len, false);
 }

 static void tcrypt_complete(struct crypto_async_request *req, int err)

-- 
Denis Cheng

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead
  2007-11-30  1:20                   ` rae l
@ 2007-11-30  6:00                     ` Herbert Xu
  0 siblings, 0 replies; 13+ messages in thread
From: Herbert Xu @ 2007-11-30  6:00 UTC (permalink / raw)
  To: rae l
  Cc: Andrew Morton, Richard Knutsson, linux-crypto, linux-kernel,
	dengxw, Randy Dunlap, Joe Perches

On Fri, Nov 30, 2007 at 09:20:34AM +0800, rae l wrote:
> 
> Cc: Randy Dunlap <randy.dunlap@oracle.com>
> Signed-off-by: Denis Cheng <crquan@gmail.com>

Patch applied.  Thanks a lot Denis!
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-11-30  6:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-26  7:13 [PATCH 1/2] crypto test: use print_hex_dump from <linux/kernel.h> Denis Cheng
2007-11-26 14:39 ` Herbert Xu
2007-11-26 17:28   ` [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead Denis Cheng
2007-11-26 18:01     ` Joe Perches
2007-11-27  1:35       ` Herbert Xu
2007-11-27  2:47         ` [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead Denis Cheng
2007-11-27  2:58           ` Richard Knutsson
2007-11-27  5:03             ` rae l
2007-11-27  9:26               ` Andrew Morton
2007-11-29 11:13                 ` Herbert Xu
2007-11-30  1:20                   ` rae l
2007-11-30  6:00                     ` Herbert Xu
2007-11-27  1:05     ` [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead Herbert Xu

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).