public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: 'Andy Shevchenko' <andriy.shevchenko@linux.intel.com>
To: David Laight <David.Laight@aculab.com>
Cc: Mike Snitzer <snitzer@kernel.org>,
	Heinz Mauelshagen <heinzm@redhat.com>,
	"dm-devel@redhat.com" <dm-devel@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Alasdair Kergon <agk@redhat.com>
Subject: Re: [PATCH v1 1/1] dm integrity: Use %*ph for printing hexdump of a small buffer
Date: Tue, 13 Jun 2023 18:10:00 +0300	[thread overview]
Message-ID: <ZIiGyPMMcIxZHH9u@smile.fi.intel.com> (raw)
In-Reply-To: <516b13b634374885891ac1e808d37ce3@AcuMS.aculab.com>

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



      reply	other threads:[~2023-06-13 15:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 21:47 [PATCH v1 1/1] dm integrity: Use %*ph for printing hexdump of a small buffer Andy Shevchenko
2023-06-13 13:13 ` David Laight
2023-06-13 15:10   ` 'Andy Shevchenko' [this message]

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=ZIiGyPMMcIxZHH9u@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=David.Laight@aculab.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=heinzm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snitzer@kernel.org \
    /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