Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-30 Thread Rasmus Villemoes
On 29/08/2019 19.39, Uwe Kleine-König wrote: > On 8/29/19 11:09 AM, Rasmus Villemoes wrote: >> still prefer making it %pE, both because it's easier to convert integers >> to ERR_PTRs than having to worry about the type of PTR_ERR() being long >> and not int, and because alphanumerics after %p have

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-30 Thread Uwe Kleine-König
Hello Petr, On 8/30/19 11:06 AM, Petr Mladek wrote: > On Thu 2019-08-29 19:39:45, Uwe Kleine-König wrote: >> On 8/29/19 11:09 AM, Rasmus Villemoes wrote: >>> On 29/08/2019 10.27, Juergen Gross wrote: Hmm, what about already existing format strings conatining "%dE"? Yes, I could fin

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-30 Thread Petr Mladek
On Thu 2019-08-29 19:39:45, Uwe Kleine-König wrote: > On 8/29/19 11:09 AM, Rasmus Villemoes wrote: > > On 29/08/2019 10.27, Juergen Gross wrote: > >> On 29.08.19 10:12, Petr Mladek wrote: > >>> On Wed 2019-08-28 21:18:37, Uwe Kleine-König  wrote: > > I'd like to postpone the discussion a

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-29 Thread Uwe Kleine-König
On 8/29/19 11:09 AM, Rasmus Villemoes wrote: > On 29/08/2019 10.27, Juergen Gross wrote: >> On 29.08.19 10:12, Petr Mladek wrote: >>> On Wed 2019-08-28 21:18:37, Uwe Kleine-König  wrote: I'd like to postpone the discussion about "how" until we agreed about the "if at all". >>> >>> It

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-29 Thread Andy Shevchenko
On Wed, Aug 28, 2019 at 12:14 AM Uwe Kleine-König wrote: > > The new format specifier %dE introduced with this patch pretty-prints > the typical negative error values. So > > pr_info("probing failed (%dE)\n", ret); > > yields > > probing failed (EIO) > > if ret holds -EIO. This is

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-29 Thread Rasmus Villemoes
On 29/08/2019 10.27, Juergen Gross wrote: > On 29.08.19 10:12, Petr Mladek wrote: >> On Wed 2019-08-28 21:18:37, Uwe Kleine-König  wrote: >>> >>> I'd like to postpone the discussion about "how" until we agreed about >>> the "if at all". >> >> It seems that all people like this feature. > > Hmm, wh

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-29 Thread Rasmus Villemoes
On 29/08/2019 10.12, Petr Mladek wrote: > On Wed 2019-08-28 21:18:37, Uwe Kleine-König wrote: > BTW: I though more about generating or cut&pasting the arrary. > I can't find any reasonable way how to generate it. Something like this seems to work, though it probably needs some massage to be acce

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-29 Thread Juergen Gross
On 29.08.19 10:12, Petr Mladek wrote: On Wed 2019-08-28 21:18:37, Uwe Kleine-König wrote: Hello Petr, On 8/28/19 1:32 PM, Petr Mladek wrote: On Tue 2019-08-27 23:12:44, Uwe Kleine-König wrote: Petr Mladek had some concerns: There are ideas to make the code even more tricky to reduce the si

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-29 Thread Petr Mladek
On Wed 2019-08-28 21:18:37, Uwe Kleine-König wrote: > Hello Petr, > > On 8/28/19 1:32 PM, Petr Mladek wrote: > > On Tue 2019-08-27 23:12:44, Uwe Kleine-König wrote: > >> Petr Mladek had some concerns: > >>> There are ideas to make the code even more tricky to reduce > >>> the size, keep it fast.

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Sergey Senozhatsky
On (08/28/19 18:22), Uwe Kleine-König wrote: > That is wrong. When you do > > pr_err("There are no round tuits to give out: %dE\n", -ENOENT); > > in a kernel that doesn't support %dE you get: > > There are no round tuits to give out: -2E OK. Good point. -ss

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Mark Brown
On Wed, Aug 28, 2019 at 09:59:16PM +0200, Uwe Kleine-König wrote: > On 8/28/19 1:32 PM, Petr Mladek wrote: > > Please, do the opposite. Add conversion of few subsystems into the > > patchset and add more people into CC. We will see immediately whether > > it makes sense to spend time on this. > F

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Uwe Kleine-König
On 8/28/19 1:32 PM, Petr Mladek wrote: > On Tue 2019-08-27 23:12:44, Uwe Kleine-König wrote: >> I dropped the example conversion, I think the idea should be clear now >> even without an explicit example. > > Please, do the opposite. Add conversion of few subsystems into the > patchset and add mor

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Uwe Kleine-König
Hello Petr, On 8/28/19 1:32 PM, Petr Mladek wrote: > On Tue 2019-08-27 23:12:44, Uwe Kleine-König wrote: >> Petr Mladek had some concerns: >>> There are ideas to make the code even more tricky to reduce >>> the size, keep it fast. >> >> I think Enrico Weigelt's suggestion to use a case is the bes

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Uwe Kleine-König
On 8/28/19 2:59 PM, Sergey Senozhatsky wrote: > On (08/28/19 14:49), Rasmus Villemoes wrote: >> On 28/08/2019 14.02, Sergey Senozhatsky wrote: >>> On (08/28/19 14:54), Jani Nikula wrote: >>> [..] > I personally think that this feature is not worth the code, data, > and bikeshedding. >>

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Sergey Senozhatsky
On (08/28/19 14:49), Rasmus Villemoes wrote: > On 28/08/2019 14.02, Sergey Senozhatsky wrote: > > On (08/28/19 14:54), Jani Nikula wrote: > > [..] > >>> I personally think that this feature is not worth the code, data, > >>> and bikeshedding. > >> > >> The obvious alternative, I think already menti

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Rasmus Villemoes
On 28/08/2019 14.02, Sergey Senozhatsky wrote: > On (08/28/19 14:54), Jani Nikula wrote: > [..] >>> I personally think that this feature is not worth the code, data, >>> and bikeshedding. >> >> The obvious alternative, I think already mentioned, is to just add >> strerror() or similar as a function

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Sergey Senozhatsky
On (08/28/19 14:54), Jani Nikula wrote: [..] > > I personally think that this feature is not worth the code, data, > > and bikeshedding. > > The obvious alternative, I think already mentioned, is to just add > strerror() or similar as a function. I doubt there'd be much opposition > to that. Folks

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Jani Nikula
On Wed, 28 Aug 2019, Petr Mladek wrote: > On Tue 2019-08-27 23:12:44, Uwe Kleine-König wrote: >> Petr Mladek had some concerns: >> > The array is long, created by cpu&paste, the index of each code >> > is not obvious. >> >> Yeah right, the array is long. This cannot really be changed because we

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-28 Thread Petr Mladek
On Tue 2019-08-27 23:12:44, Uwe Kleine-König wrote: > Petr Mladek had some concerns: > > The array is long, created by cpu&paste, the index of each code > > is not obvious. > > Yeah right, the array is long. This cannot really be changed because we > have that many error codes. I don't understand

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-27 Thread Joe Perches
On Tue, 2019-08-27 at 23:35 +0200, Uwe Kleine-König wrote: > Hello Joe, > > On 8/27/19 11:22 PM, Joe Perches wrote: > > On Tue, 2019-08-27 at 23:12 +0200, Uwe Kleine-König wrote: > > > The new format specifier %dE introduced with this patch pretty-prints > > > the typical negative error values. So

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-27 Thread Uwe Kleine-König
Hello Joe, On 8/27/19 11:22 PM, Joe Perches wrote: > On Tue, 2019-08-27 at 23:12 +0200, Uwe Kleine-König wrote: >> The new format specifier %dE introduced with this patch pretty-prints >> the typical negative error values. So >> >> pr_info("probing failed (%dE)\n", ret); >> >> yields >> >>

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-27 Thread Joe Perches
On Tue, 2019-08-27 at 23:12 +0200, Uwe Kleine-König wrote: > The new format specifier %dE introduced with this patch pretty-prints > the typical negative error values. So > > pr_info("probing failed (%dE)\n", ret); > > yields > > probing failed (EIO) > > if ret holds -EIO. This is e

Re: [PATCH v2] vsprintf: introduce %dE for error constants

2019-08-27 Thread Uwe Kleine-König
Hello, I fat-fingered Enrico Weigelt's e-mail address. Please when you reply to my patch fix that up (i.e. drop enr...@kleine-koenig.org and weig...@kleine-koenig.org). Thanks and sorry, Uwe signature.asc Description: OpenPGP digital signature

[PATCH v2] vsprintf: introduce %dE for error constants

2019-08-27 Thread Uwe Kleine-König
The new format specifier %dE introduced with this patch pretty-prints the typical negative error values. So pr_info("probing failed (%dE)\n", ret); yields probing failed (EIO) if ret holds -EIO. This is easier to understand than the for now common probing failed (-5) (