[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1404807878.5102.85.camel@smile.fi.intel.com>
Date: Tue, 08 Jul 2014 11:24:38 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Joe Perches <joe@...ches.com>
Cc: "John W . Linville" <linville@...driver.com>,
Johannes Berg <johannes@...solutions.net>,
devel@...verdev.osuosl.org, linux-wireless@...r.kernel.org,
linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 04/10] lib/vsprintf: add %*pE[achnops] format
specifier
On Mon, 2014-07-07 at 09:50 -0700, Joe Perches wrote:
> On Mon, 2014-07-07 at 18:21 +0300, Andy Shevchenko wrote:
>
> > diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> []
> > static noinline_for_stack
> > +char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec,
> > + const char *fmt)
> []
> > + if (spec.field_width == 0)
> > + /* nothing to print */
> > + return buf;
> []
> > + len = spec.field_width < 0 ? 1 : spec.field_width;
>
> If field_width is not specified, emit a single byte?
A single byte to be escaped (it might be \000, for example, on output).
> Perhaps better if -1 was accepted by string_escape_mem
> as a strlen request or just ignored as a 0 length is
> above.
Would it be any benefit here?
> fyi: hex_string emits nothing on printk("%ph", buf);
Works just fine. How did you check it?
pr_info("%ph\n", in); => test_string_helpers: 1b
(I suppose "\n" flushes a buffer for me.)
--
Andy Shevchenko <andriy.shevchenko@...el.com>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists