All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Joe Perches <joe@perches.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors <kernel-janitors@vger.kernel.org>
Subject: Re: Use of '%#02x' is almost always wrong
Date: Wed, 13 Oct 2021 09:15:47 +0300	[thread overview]
Message-ID: <20211013061547.GG8429@kadam> (raw)
In-Reply-To: <b04a10ea9682c51764053c1be73d4b3be59d1e7f.camel@perches.com>

On Sun, Oct 10, 2021 at 09:45:30AM -0700, Joe Perches wrote:
> Perhaps too many developers do not know that using '%#<width>x'
> in printf output _includes_ the 0x prefix in the output width.
> 

This is a good point.  Presumably you're going to add it to checkpatch.pl?

I looked at '%#04x' and you would think those would all be printing char
types but some are printing shorts.  :/  It's harder to deal with that
because 50% are correct from the tiny sample I looked at.

regards,
dan carpenter


  parent reply	other threads:[~2021-10-13  6:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-10 16:45 Use of '%#02x' is almost always wrong Joe Perches
2021-10-12 21:10 ` David Laight
2021-10-13 23:16   ` Bernd Petrovitsch
2021-10-14  8:27     ` David Laight
2021-10-13  6:15 ` Dan Carpenter [this message]
2021-10-13  8:17   ` Joe Perches
2021-10-13 10:39     ` Dan Carpenter

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=20211013061547.GG8429@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.