Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-29 Thread Herbert Xu
On Fri, Nov 30, 2007 at 09:20:34AM +0800, rae l wrote:
> 
> Cc: Randy Dunlap <[EMAIL PROTECTED]>
> Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>

Patch applied.  Thanks a lot Denis!
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-29 Thread rae l
On Nov 29, 2007 7:13 PM, Herbert Xu <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-29 Thread Herbert Xu
On Tue, Nov 27, 2007 at 01:26:22AM -0800, Andrew Morton wrote:
> On Tue, 27 Nov 2007 13:03:29 +0800 "rae l" <[EMAIL PROTECTED]> 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~} <[EMAIL PROTECTED]>
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-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-29 Thread Herbert Xu
On Tue, Nov 27, 2007 at 01:26:22AM -0800, Andrew Morton wrote:
 On Tue, 27 Nov 2007 13:03:29 +0800 rae l [EMAIL PROTECTED] 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 ~{PmVHI~} [EMAIL PROTECTED]
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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-29 Thread rae l
On Nov 29, 2007 7:13 PM, Herbert Xu [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---

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
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-29 Thread Herbert Xu
On Fri, Nov 30, 2007 at 09:20:34AM +0800, rae l wrote:
 
 Cc: Randy Dunlap [EMAIL PROTECTED]
 Signed-off-by: Denis Cheng [EMAIL PROTECTED]

Patch applied.  Thanks a lot Denis!
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
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-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-27 Thread Andrew Morton
On Tue, 27 Nov 2007 13:03:29 +0800 "rae l" <[EMAIL PROTECTED]> 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-27 Thread Andrew Morton
On Tue, 27 Nov 2007 13:03:29 +0800 rae l [EMAIL PROTECTED] 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.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-26 Thread rae l
On Nov 27, 2007 10:58 AM, Richard Knutsson <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-26 Thread Richard Knutsson

Denis Cheng wrote:

Cc: Randy Dunlap <[EMAIL PROTECTED]>
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-26 Thread Denis Cheng
Cc: Randy Dunlap <[EMAIL PROTECTED]>
Signed-off-by: Denis Cheng <[EMAIL PROTECTED]>
---
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-26 Thread Denis Cheng
Cc: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
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

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-26 Thread Richard Knutsson

Denis Cheng wrote:

Cc: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
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

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead

2007-11-26 Thread rae l
On Nov 27, 2007 10:58 AM, Richard Knutsson [EMAIL PROTECTED] 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 [EMAIL PROTECTED]
Signed-off-by: Denis Cheng [EMAIL PROTECTED]
---
 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
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/