[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a8748490705301536p7c4d2918u1ee4ae1b6ec268f4@mail.gmail.com>
Date: Thu, 31 May 2007 00:36:14 +0200
From: "Jesper Juhl" <jesper.juhl@...il.com>
To: "Randy Dunlap" <randy.dunlap@...cle.com>
Cc: "Christoph Lameter" <clameter@....com>,
"Andrew Morton" <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, hugh@...itas.com
Subject: Re: [PATCH 1/3] hexdump: more output formatting
On 30/05/07, Randy Dunlap <randy.dunlap@...cle.com> wrote:
> From: Randy Dunlap <randy.dunlap@...cle.com>
>
Some friendly nitpicking below :-)
> Add a prefix string parameter. Callers are responsible for any
> string length/alignment that they want to see in the output. I.e.,
> callers should pad strings to achieve alignment if they want that.
>
> Add rowsize parameter. This is the number of raw data bytes
> to be printed per line. Must be 16 or 32.
>
> Add a group_size parameter. This allows callers to dump values
One is called "rowsize" the other "group_size". How about consistent
naming; either "row_size" and "group_size" or "rowsize" and
"groupsize" ?
> as 1-byte, 2-byte, 4-byte, or 8-byte numbers. Default is
> 1-byte numbers. If the total length is not an even multiple
> of group_size, 1-byte numbers are printed.
>
> Add an "ascii" output parameter. This causes ASCII data output
> following the hex data output.
>
> Clean up some doc examples.
>
> Signed-off-by: Randy Dunlap <randy.dunlap@...cle.com>
> ---
[snip]
> +
> + switch (group_size) {
> + case 8: {
> + const u64 *ptr8 = buf;
> + int ngroups = len / group_size;
> +
> + for (j = 0; j < ngroups; j++)
> + lx += scnprintf(linebuf + lx, linebuflen - lx,
> + "%16.16llx ", (unsigned long long)*(ptr8 + j));
> + break;
> + }
> +
I don't see the point in this (and the other) extra blank lines
between closing brace of one case and the start of the next. Removing
the blank line wouldn't hurt readability but would allow more lines of
code to be visible on the screen at once.
> + case 4: {
[snip]
Apart from those nits, nice patch, nice improvement.
--
Jesper Juhl <jesper.juhl@...il.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists