devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Grant Likely <grant.likely@linaro.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: Re: [PATCH v2] of/address: replace printk() with pr_debug() / pr_err()
Date: Wed, 09 Dec 2015 12:09:28 -0800	[thread overview]
Message-ID: <1449691768.25389.51.camel@perches.com> (raw)
In-Reply-To: <CAHp75VdHrG_uk9K7B=q8+ZnjNehJ2AY=-RsMGByxn62Uh_-sRA@mail.gmail.com>

On Wed, 2015-12-09 at 22:02 +0200, Andy Shevchenko wrote:
> On Wed, Dec 9, 2015 at 9:28 PM, Joe Perches <joe@perches.com> wrote:
[]
> > > > diff --git a/lib/hexdump.c b/lib/hexdump.c
> > > > index 992457b..49113aa 100644
> > > > --- a/lib/hexdump.c
> > > > +++ b/lib/hexdump.c
> > > > @@ -81,6 +81,7 @@ EXPORT_SYMBOL(bin2hex);
> > > >   * @len: number of bytes in the @buf
> > > >   * @rowsize: number of bytes to print per line; must be 16 or 32
> > > >   * @groupsize: number of bytes to print at a time (1, 2, 4, 8; default = 1)
> > > > + *             OR'd with DUMP_TYPE_BE or DUMP_TYPE_LE for endian conversions
> > > >   * @linebuf: where to put the converted data
> > > >   * @linebuflen: total size of @linebuf, including space for terminating NUL
> > > >   * @ascii: include ASCII after the hex output
> > > > @@ -114,19 +115,20 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize,
> > > >         int j, lx = 0;
> > > >         int ascii_column;
> > > >         int ret;
> > > > +       int actual_groupsize = groupsize & ~(DUMP_TYPE_LE | DUMP_TYPE_BE);
> > > 
> > > I would rather prefer to have function parameter to be renamed.
> > > 
> > > E.g. gsflags ?
> > > 
> > 
> > Well, it's a bit simpler changelog.
> 
> Generally I'm fine with this version, though take into account above and below.
> 
> > ---
> >  include/linux/printk.h |  7 +++++++
> >  lib/hexdump.c          | 39 +++++++++++++++++++++++++++++++--------
> >  2 files changed, 38 insertions(+), 8 deletions(-)
> > 
> > diff --git a/include/linux/printk.h b/include/linux/printk.h
> > index 9729565..4be190c 100644
> > --- a/include/linux/printk.h
> > +++ b/include/linux/printk.h
> > @@ -424,6 +424,13 @@ enum {
> >         DUMP_PREFIX_ADDRESS,
> >         DUMP_PREFIX_OFFSET
> >  };
> > +
> > +enum {
> > +       DUMP_TYPE_CPU = 0,
> 
> And still open this, do we need it? I think you may just mention in
> the documentation that default behaviour is CPU like.

The only documentation I'm aware of is the kernel-doc

> > +       DUMP_TYPE_LE = BIT(30),
> > +       DUMP_TYPE_BE = BIT(31)
> > +};
> > +
> >  extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize,
> >                               int groupsize, char *linebuf, size_t linebuflen,
> 
> Here as well to change.

Right, thanks.

> >                               bool ascii);
> > diff --git a/lib/hexdump.c b/lib/hexdump.c
> > index 992457b..5b1eda70 100644
> > --- a/lib/hexdump.c
> > +++ b/lib/hexdump.c
> > @@ -80,7 +80,8 @@ EXPORT_SYMBOL(bin2hex);
> >   * @buf: data blob to dump
> >   * @len: number of bytes in the @buf
> >   * @rowsize: number of bytes to print per line; must be 16 or 32
> > - * @groupsize: number of bytes to print at a time (1, 2, 4, 8; default = 1)
> > + * @groupflags: number of bytes to print at a time (1, 2, 4, 8; default = 1)
> > + *              OR with DUMP_TYPE_BE or DUMP_TYPE_LE for endian conversions
> 
> Maybe specify "bitwise OR with.." ?

  reply	other threads:[~2015-12-09 20:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 16:07 [PATCH v2] of/address: replace printk() with pr_debug() / pr_err() Masahiro Yamada
2015-12-08 16:16 ` Joe Perches
2015-12-08 17:03   ` Joe Perches
2015-12-08 21:28     ` Rob Herring
2015-12-09  0:03       ` Joe Perches
     [not found]         ` <1449619439.18646.20.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2015-12-09 12:03           ` Andy Shevchenko
2015-12-09 19:28             ` Joe Perches
     [not found]               ` <1449689319.25389.28.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2015-12-09 20:02                 ` Andy Shevchenko
2015-12-09 20:09                   ` Joe Perches [this message]
     [not found]                   ` <CAHp75VdHrG_uk9K7B=q8+ZnjNehJ2AY=-RsMGByxn62Uh_-sRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-09 20:17                     ` Rasmus Villemoes
2015-12-09 20:36                       ` Andy Shevchenko
2015-12-09 20:42                         ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449691768.25389.51.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=robh+dt@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).