lkml.org 
[lkml]   [2020]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/2] printf: add support for %de
Date
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

\
 
 \ /
  Last update: 2020-01-20 09:56    [W:0.069 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site