Linux Documentation
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH v1 1/2] docs: printk-formats: Fix hex printing of signed values
Date: Fri, 14 Jul 2023 17:32:26 +0200	[thread overview]
Message-ID: <ZLFqivvdbzFnAAgY@alley> (raw)
In-Reply-To: <20230703145839.14248-1-andriy.shevchenko@linux.intel.com>

On Mon 2023-07-03 17:58:38, Andy Shevchenko wrote:
> The commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
> unnecessary %h[xudi] and %hh[xudi]") obviously missed the point of sign
> promotion for the signed values lesser than int. In such case %x prints
> not the same as %h[h]x. Restore back those specifiers for the signed hex
> cases.
> 
> Fixes: cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Makes sense. %d would print the same (small) negative number even when
casted do int. But %x would always add more "ff"s up to 4 bytes.

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

      parent reply	other threads:[~2023-07-14 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 14:58 [PATCH v1 1/2] docs: printk-formats: Fix hex printing of signed values Andy Shevchenko
2023-07-03 14:58 ` [PATCH v1 2/2] docs: printk-formats: Treat char as always unsigned Andy Shevchenko
2023-07-14 15:34   ` Petr Mladek
2023-07-14 16:04     ` Andy Shevchenko
2023-07-18 11:46       ` Petr Mladek
2023-07-03 15:08 ` [PATCH v1 1/2] docs: printk-formats: Fix hex printing of signed values Andy Shevchenko
2023-07-14 15:32 ` Petr Mladek [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=ZLFqivvdbzFnAAgY@alley \
    --to=pmladek@suse.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.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