[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190418144356.GB16037@tigerII.localdomain>
Date: Thu, 18 Apr 2019 23:43:56 +0900
From: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"Tobin C . Harding" <me@...in.cc>, Joe Perches <joe@...ches.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.cz>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 07/10] vsprintf: Consolidate handling of unknown
pointer specifiers
On (04/17/19 13:53), Petr Mladek wrote:
[..]
> char *ip_addr_string(char *buf, char *end, const void *ptr,
> struct printf_spec spec, const char *fmt)
> {
> + char *err_fmt_msg;
> +
> switch (fmt[1]) {
> case '6':
> return ip6_addr_string(buf, end, ptr, spec, fmt);
> @@ -1457,7 +1459,8 @@ char *ip_addr_string(char *buf, char *end, const void *ptr,
> }}
> }
>
> - return ptr_to_id(buf, end, ptr, spec);
> + err_fmt_msg = fmt[0] == 'i' ? "(%pi?)" : "(%pI?)";
> + return string_nocheck(buf, end, err_fmt_msg, spec);
> }
We cannot err on fmt[0] here, can we. Both %pi and %pI are OK
and handled by pointer():
switch (fmt[0]) {
case 'I':
case 'i':
return ip_addr_string(buf, end, ptr, spec, fmt);
It's fmt[1] which can be unrecognized:
switch (fmt[1]) {
case '6':
case '4':
case 'S':
}
-ss
Powered by blists - more mailing lists