[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZIiGyPMMcIxZHH9u@smile.fi.intel.com>
Date: Tue, 13 Jun 2023 18:10:00 +0300
From: 'Andy Shevchenko' <andriy.shevchenko@...ux.intel.com>
To: David Laight <David.Laight@...lab.com>
Cc: Mike Snitzer <snitzer@...nel.org>,
Heinz Mauelshagen <heinzm@...hat.com>,
"dm-devel@...hat.com" <dm-devel@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Alasdair Kergon <agk@...hat.com>
Subject: Re: [PATCH v1 1/1] dm integrity: Use %*ph for printing hexdump of a
small buffer
On Tue, Jun 13, 2023 at 01:13:54PM +0000, David Laight wrote:
> From: Andy Shevchenko
> > Sent: 12 June 2023 22:48
> >
> > The kernel already has a helper to print a hexdump of a small
> > buffer via pointer extension. Use that instead of open coded
> > variant.
> >
> > In long term it helps to kill pr_cont() or at least narrow down
> > its use.
> >
> > Note, the format is slightly changed, i.e. the colon is not printed
> > before the buffer dump and the trailing space is always printed.
> > These are not a problem since it's a debug message. Also the IV dump
> > is limited by 64 bytes which seems fine.
> ...
> > +#define DEBUG_bytes(bytes, len, msg, ...) printk(KERN_DEBUG msg " %*ph\n", ##__VA_ARGS__, len,
> > bytes)
>
> Using:
> printf(KERN_DEBUG msg "%s%*ph\n", ##__VA_ARGS__, len ? ": " : "", len, bytes)
> would add back the optional ':'.
Yes, I considered that and decided to avoid. This is debug and hence the format
may vary anyway. That said, up to maintainers.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists