[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180205094438.pfd7ffymlvklpxe7@pathway.suse.cz>
Date: Mon, 5 Feb 2018 10:44:38 +0100
From: Petr Mladek <pmladek@...e.com>
To: Adam Borowski <kilobyte@...band.pl>
Cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
linux-kernel@...r.kernel.org, "Tobin C. Harding" <me@...in.cc>,
Andrew Morton <akpm@...ux-foundation.org>,
Joe Perches <joe@...ches.com>,
Kees Cook <keescook@...omium.org>,
"Roberts, William C" <william.c.roberts@...el.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
David Laight <David.Laight@...LAB.COM>,
Randy Dunlap <rdunlap@...radead.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [PATCH] vsprintf: avoid misleading "(null)" for %px
Hi,
I add people who actively commented on adding %px modifier,
see the thread starting at
https://lkml.kernel.org/r/1511921105-3647-5-git-send-email-me@tobin.cc
Just for reference. It seems to be related to the commit 9f36e2c448007b54
("printk: use %pK for /proc/kallsyms and /proc/modules").
On Sun 2018-02-04 18:45:21, Adam Borowski wrote:
> Like %pK already does, print "00000000" instead.
>
> This confused people -- the convention is that "(null)" means you tried to
> dereference a null pointer as opposed to printing the address.
By other words, this avoids regressions when people convert
%x to %px. Do I get it right, please?
> Signed-off-by: Adam Borowski <kilobyte@...band.pl>
> ---
> lib/vsprintf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index 77ee6ced11b1..d7a708f82559 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -1849,7 +1849,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
> {
> const int default_width = 2 * sizeof(void *);
>
> - if (!ptr && *fmt != 'K') {
> + if (!ptr && *fmt != 'K' && *fmt != 'x') {
> /*
> * Print (null) with the same width as a pointer so it makes
> * tabular output look nice.
> --
> 2.15.1
>
Powered by blists - more mailing lists