mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] printf: add support for %de
@ 2020-01-20  8:55 Uwe Kleine-König
  2020-01-20  8:55 ` [PATCH 1/2] printf: add support for printing symbolic error names from numbers Uwe Kleine-König
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2020-01-20  8:55 UTC (permalink / raw)
  To: Petr Mladek, Steven Rostedt, Sergey Senozhatsky, Andy Shevchenko,
	Rasmus Villemoes, Greg Kroah-Hartman, Rafael J. Wysocki
  Cc: linux-kernel, kernel

Hello,

this is an reiteration of my patch from some time ago that introduced
%dE with the same semantic. Back then this resulted in the support for
%pe which was less contentious.

I still consider %de (now with a small 'e' to match %pe) useful.

One concern back then was that drivers/staging/speakup/speakup_bns.c
uses sprintf with the format string "\x05%dE" to produce binary data
expecting a literal 'E'. This is now addressed: ` can be used to end
parsing a format specifier as explained in the commit log of the first
patch.

Of course the concern to not complicate vsprintf() cannot be addressed
as new code is necessary to support this new ability. I still consider
%de useful enough, even though you could do

	pr_info("blablub: %pe\n", ERR_PTR(ret));

with the same effect as

	pr_info("blablub: %de\n", ret);

.

The second patch converts some strings in the driver core to use this
new format specifier.

Uwe Kleine-König (2):
  printf: add support for printing symbolic error names from numbers
  driver core: convert probe error messages to use %de

 drivers/base/dd.c | 10 +++++-----
 lib/test_printf.c |  8 ++++++++
 lib/vsprintf.c    | 34 +++++++++++++++++++++++++++++++++-
 3 files changed, 46 insertions(+), 6 deletions(-)

-- 
2.24.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-29 11:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20  8:55 [PATCH 0/2] printf: add support for %de Uwe Kleine-König
2020-01-20  8:55 ` [PATCH 1/2] printf: add support for printing symbolic error names from numbers Uwe Kleine-König
2020-01-20  8:55 ` [PATCH 2/2] driver core: convert probe error messages to use %de Uwe Kleine-König
2020-01-20  9:19 ` [PATCH 0/2] printf: add support for %de Joe Perches
2020-01-20  9:32 ` Andy Shevchenko
2020-01-21 10:27   ` Rasmus Villemoes
2020-01-29 11:55     ` Petr Mladek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®