Messages in this thread | | | From | Uwe Kleine-König <> | Subject | [PATCH 0/2] printf: add support for %de | Date | Mon, 20 Jan 2020 09:55:06 +0100 |
| |
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
| |