RE: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-30 Thread David Laight
From: Enrico Weigelt, metux IT consult > Sent: 26 August 2019 14:29 > On 25.08.19 01:37, Uwe Kleine-König wrote: > > Hi, > > > +static noinline_for_stack > +char *errstr(char *buf, char *end, unsigned > > long long num,> + > struct printf_spec spec)> +{ > #1: why not putting that into some sepa

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-29 Thread Andy Shevchenko
On Sun, Aug 25, 2019 at 2:40 AM Uwe Kleine-König wrote: > > pr_info("probing failed (%dE)\n", ret); > > expands to > > probing failed (EIO) > > if ret holds -EIO (or EIO). This introduces an array of error codes. If > the error code is missing, %dE falls back to %d and so prints th

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-26 Thread Enrico Weigelt, metux IT consult
On 25.08.19 01:37, Uwe Kleine-König wrote: Hi, +static noinline_for_stack > +char *errstr(char *buf, char *end, unsigned long long num,> + struct printf_spec spec)> +{ #1: why not putting that into some separate strerror() lib function ? This is something I've been looking for quite some

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-26 Thread Petr Mladek
On Sun 2019-08-25 11:14:42, Uwe Kleine-König wrote: > Hello Andrew, > > On Sat, Aug 24, 2019 at 04:58:29PM -0700, Andrew Morton wrote: > > (cc printk maintainers). > > Ah, I wasn't aware there is something like them. Thanks > > > On Sun, 25 Aug 2019 01:37:23 +0200 Uwe Kleine-König > > wrote:

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-26 Thread Rasmus Villemoes
On 25/08/2019 01.37, Uwe Kleine-König wrote: > pr_info("probing failed (%dE)\n", ret); > > expands to > > probing failed (EIO) > > if ret holds -EIO (or EIO). This introduces an array of error codes. If > the error code is missing, %dE falls back to %d and so prints the plain > numbe

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-26 Thread Jani Nikula
On Mon, 26 Aug 2019, Jani Nikula wrote: > On Sat, 24 Aug 2019, Andrew Morton wrote: >>> --- a/lib/vsprintf.c >>> +++ b/lib/vsprintf.c >>> @@ -533,6 +533,192 @@ char *number(char *buf, char *end, unsigned long long >>> num, >>> return buf; >>> } >>> >>> +#define ERRORCODE(x) { .str = #x, .

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-26 Thread Jani Nikula
On Sat, 24 Aug 2019, Andrew Morton wrote: >> --- a/lib/vsprintf.c >> +++ b/lib/vsprintf.c >> @@ -533,6 +533,192 @@ char *number(char *buf, char *end, unsigned long long >> num, >> return buf; >> } >> >> +#define ERRORCODE(x) { .str = #x, .err = x } >> + >> +static const struct { >> +c

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-25 Thread Sergey Senozhatsky
On (08/24/19 16:58), Andrew Morton wrote: > On Sun, 25 Aug 2019 01:37:23 +0200 Uwe Kleine-König > wrote: > > > pr_info("probing failed (%dE)\n", ret); > > > > expands to > > > > probing failed (EIO) > > > > if ret holds -EIO (or EIO). This introduces an array of error codes. If > > th

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-25 Thread Uwe Kleine-König
Hello Andrew, On Sat, Aug 24, 2019 at 04:58:29PM -0700, Andrew Morton wrote: > (cc printk maintainers). Ah, I wasn't aware there is something like them. Thanks > On Sun, 25 Aug 2019 01:37:23 +0200 Uwe Kleine-König > wrote: > > > pr_info("probing failed (%dE)\n", ret); > > > > expands to

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-24 Thread Andrew Morton
(cc printk maintainers). On Sun, 25 Aug 2019 01:37:23 +0200 Uwe Kleine-König wrote: > pr_info("probing failed (%dE)\n", ret); > > expands to > > probing failed (EIO) > > if ret holds -EIO (or EIO). This introduces an array of error codes. If > the error code is missing, %dE fal