lkml.org 
[lkml]   [2019]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] vsprintf: introduce %dE for error constants
From
Date
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
> > >
> > > 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)
> >
> > I suggest using both outputs like '-5 -EIO'
> > rather than a single string
>
> I like it the way it is implemented as it is more flexible. If you want
> to see both, you can still do
>
> pr_info("probing failed (%d %dE)\n", ret, ret);
>
> and people (like me) who think that giving only EIO can still do just that.

<shrug> Up to you. Just a suggestion.

btw:

The test for %<dixu>E (FORMAT_TYPE_INT)
should probably include a test for

(spec->flags & SIGN)

so that it only is used for %d and %i and
disregarded for %x and %u


\
 
 \ /
  Last update: 2019-08-28 01:11    [W:0.034 / U:2.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site