lkml.org 
[lkml]   [2021]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/5] vsprintf/Documentation: Add X to %*ph extension to output upper case hex
From
Date
On Fri, 2021-08-27 at 10:48 +0300, Andy Shevchenko wrote:
> On Thu, Aug 26, 2021 at 11:43:01AM -0700, Joe Perches wrote:
> > A few sysfs output uses of hex arrays are uppercase and are nominally ABI.
> >
> > Add a mechanism to the existing vsprintf %*ph hex output extension to
> > support upper case hex output.
>
> ...
>
> > + The preferred output is lowercase
> >   %*ph 00 01 02 ... 3f
> >   %*phC 00:01:02: ... :3f
> >   %*phD 00-01-02- ... -3f
> >   %*phN 000102 ... 3f
> > + Formats with X are uppercase, used for backwards compatibility
> > + %*phX 00 01 02 ... 3F
> > + %*phCX 00:01:02: ... :3F
> > + %*phDX 00-01-02- ... -3F
> > + %*phNX 000102 ... 3F
>
> Why not using %*pH...?

I find X more intelligible.

> > + char locase = 0x20; /* ASCII OR'd for lower case see: number() */
>
> If you use h vs H, you may derive this from (fmt[...] & SMALL).

It's not necessary to use any more of the rather limited vsprintf
extension namespace.


\
 
 \ /
  Last update: 2021-08-27 10:09    [W:0.067 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site