lkml.org 
[lkml]   [2015]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] of/address: replace printk() with pr_debug() / pr_err()
From
Date
On Tue, 2015-12-08 at 08:16 -0800, Joe Perches wrote:
> On Wed, 2015-12-09 at 01:07 +0900, Masahiro Yamada wrote:
> > Trivial changes suggested by checkpatch.pl.
> []
> > diff --git a/drivers/of/address.c b/drivers/of/address.c
> []
> > @@ -23,7 +23,7 @@ static int __of_address_to_resource(struct device_node *dev,
> >  #ifdef DEBUG
> >  static void of_dump_addr(const char *s, const __be32 *addr, int na)
> >  {
> > - printk(KERN_DEBUG "%s", s);
> > + pr_debug("%s", s);
> >   while (na--)
> >   printk(" %08x", be32_to_cpu(*(addr++)));
> >   printk("\n");
>
> mixing pr_debug and printk doesn't make much sense.
>
> It might be nicer to use
>
> static void of_dumpaddr(const char *s, const __be32 *addr, int na)
> {
> #ifdef DEBUG
> ...
> #endif
> }
>
> to avoid the other static declaration

Or more simply:

static void of_dumpaddr(const char *s, const __be32 *addr, int na)
{
print_hex_dump_debug(s, DUMP_PREFIX_NONE, 16, 1,
 addr, na * sizeof(__be32), false);
}


\
 
 \ /
  Last update: 2015-12-08 18:21    [W:0.090 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site