2010-07-15 06:43:09

by Kulikov Vasiliy

[permalink] [raw]
Subject: [PATCH 09/11] staging: comedi: formatting of pointers in printk()

Use %p instead of %08x in printk().

Signed-off-by: Kulikov Vasiliy <[email protected]>
---
drivers/staging/comedi/drivers/quatech_daqp_cs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
index 8d16380..8b49cb1 100644
--- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
+++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
@@ -208,7 +208,7 @@ static void hex_dump(char *str, void *ptr, int len)

for (i = 0; i < len; i++) {
if (i % 16 == 0)
- printk("\n0x%08x:", (unsigned int)cptr);
+ printk("\n%p:", cptr);

printk(" %02x", *(cptr++));
}
--
1.7.0.4


2010-07-15 06:46:58

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH 09/11] staging: comedi: formatting of pointers in printk()

On 07/15/2010 08:42 AM, Kulikov Vasiliy wrote:
> Use %p instead of %08x in printk().
>
> Signed-off-by: Kulikov Vasiliy <[email protected]>
> ---
> drivers/staging/comedi/drivers/quatech_daqp_cs.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> index 8d16380..8b49cb1 100644
> --- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> +++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> @@ -208,7 +208,7 @@ static void hex_dump(char *str, void *ptr, int len)

The name and parameters suggest to remove the function completely. (And
use print_hex_dump_bytes instead.)

>
> for (i = 0; i < len; i++) {
> if (i % 16 == 0)
> - printk("\n0x%08x:", (unsigned int)cptr);
> + printk("\n%p:", cptr);
>
> printk(" %02x", *(cptr++));
> }


--
js

2010-07-22 18:48:43

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 09/11] staging: comedi: formatting of pointers in printk()

On Thu, Jul 15, 2010 at 08:46:29AM +0200, Jiri Slaby wrote:
> On 07/15/2010 08:42 AM, Kulikov Vasiliy wrote:
> > Use %p instead of %08x in printk().
> >
> > Signed-off-by: Kulikov Vasiliy <[email protected]>
> > ---
> > drivers/staging/comedi/drivers/quatech_daqp_cs.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> > index 8d16380..8b49cb1 100644
> > --- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> > +++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
> > @@ -208,7 +208,7 @@ static void hex_dump(char *str, void *ptr, int len)
>
> The name and parameters suggest to remove the function completely. (And
> use print_hex_dump_bytes instead.)

I agree, Kulikov, can you make that chagne instead?

thanks,

greg k-h

2010-07-22 18:51:33

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 09/11] staging: comedi: formatting of pointers in printk()

On Thu, 2010-07-22 at 11:45 -0700, Greg KH wrote:
> On Thu, Jul 15, 2010 at 08:46:29AM +0200, Jiri Slaby wrote:
> > On 07/15/2010 08:42 AM, Kulikov Vasiliy wrote:
> > The name and parameters suggest to remove the function completely. (And
> > use print_hex_dump_bytes instead.)
> I agree, Kulikov, can you make that chagne instead?

The function isn't used at all and should simply be removed.