lkml.org 
[lkml]   [2013]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] lib: vsprintf: Add %pa format specifier for phys_addr_t types
From
Date
On Tue, 2013-01-22 at 09:29 +0200, Andy Shevchenko wrote:
> On Mon, 2013-01-21 at 21:47 -0800, Stepan Moskovchenko wrote:
> > Add the %pa format specifier for printing a phys_addr_t
> > type, since the physical address size on some platforms
> > can vary based on build options, regardless of the native
> > integer type.
[]
> > diff --git a/lib/vsprintf.c b/lib/vsprintf.c
[]
> @@ -1112,6 +1113,12 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
> > return netdev_feature_string(buf, end, ptr, spec);
> > }
> > break;
> > + case 'a':
> > + spec.flags |= SPECIAL | SMALL | ZEROPAD;
> > + spec.field_width = sizeof(phys_addr_t) * 2;

I believe this should be:

spec.field_width = sizeof(phys_addr_t) * 2 + 2;



\
 
 \ /
  Last update: 2013-01-22 09:44    [W:0.083 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site