lkml.org 
[lkml]   [2020]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/3] lib/vsprintf: Replace custom spec to print decimals with generic one
On (20/07/31 16:48), Steven Rostedt wrote:
[..]
> > > - static const struct printf_spec num_spec = {
> > > - .flags = SMALL,
> > > - .field_width = -1,
> > > - .precision = -1,
> > > - .base = 10,
> > > - };
> > >
> > > struct printf_spec str_spec = spec;
> > > str_spec.field_width = -1;
> > > @@ -2024,7 +2018,7 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
> > > str_spec.precision = precision;
> > > break;
> > > case 'p': /* phandle */
> > > - buf = number(buf, end, (unsigned int)dn->phandle, num_spec);
> > > + buf = number(buf, end, (unsigned int)dn->phandle, default_dec_spec);
> >
> > Could changing .precision = -1 to 0 change any output?
> >
>
> static const struct printf_spec default_dec_spec = {
> .base = 10,
> .precision = -1,
> };
>
>
> It's the field_width that changes from -1 to 0, which shouldn't cause
> any issue.

That's a good question, both .field_width and .precision are now zeroes,
and not -1. But it seems that this doesn't change anything in the end.

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

-ss

\
 
 \ /
  Last update: 2020-08-01 03:44    [W:0.498 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site