[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250117192522.0b2e7c65@pumpkin>
Date: Fri, 17 Jan 2025 19:25:22 +0000
From: David Laight <david.laight.linux@...il.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Miquel Raynal
<miquel.raynal@...tlin.com>, Steven Rostedt <rostedt@...dmis.org>, Rasmus
Villemoes <linux@...musvillemoes.dk>, Sergey Senozhatsky
<senozhatsky@...omium.org>, Jonathan Corbet <corbet@....net>, John Ogness
<john.ogness@...utronix.de>, Andrew Morton <akpm@...ux-foundation.org>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] hexdump: Allow skipping identical lines
On Fri, 17 Jan 2025 17:27:26 +0100
Petr Mladek <pmladek@...e.com> wrote:
...
> IMHO, it is perfectly fine to add support for skipping identical lines
> only to print_hex_dump(). And I would go even further and replace
>
> void print_hex_dump(const char *level, const char *prefix_str, int prefix_type,
> int rowsize, int groupsize,
> const void *buf, size_t len, bool ascii)
>
> with
>
> void print_hex_dump(const char *level, const char *prefix_str,
> enum hex_dump_type,
> int rowsize, int groupsize,
> const void *buf, size_t len)
>
> and combine all the flags into the one enum:
>
> enum hex_dump_type {
> DUMP_HEX_ONLY = 0,
> DUMP_HEX_AND_ASCII = BIT(1),
> DUMP_PREFIX_ADDRESS = BIT(2),
> DUMP_PREFIX_OFFSET = BIT(3),
> DUMP_SKIP_IDENTICAL_LINES = BIT(4),
> };
>
> How does that sound, please?
Rename it as (say) print_hex() and add wrappers for the existing callers?
David
>
> Best Regards,
> Petr
>
Powered by blists - more mailing lists