Re: [PATCH v2 06/11] lib/vsprintf: introduce %pl to print in human-readable form

From: H. Peter Anvin
Date: Thu Jan 21 2016 - 16:14:14 EST


On 01/14/16 14:23, Andy Shevchenko wrote:
> Introduce a new extension for printing given unsigned long long value in
> human-readable form with automatically choosen IEC binary prefix. The value is
> passed by reference.

Why by reference? That seems to make little sense.

The prefix should not include the unit (e.g. B) as we may want to use
another thing.

It is also worth noting that what you have here is to generate *exact*
values, which aren't always what we want. Another common thing is to
round/truncate to 3 significant figures in order to get the order of
magnitude clear; the prefix being so different depending on the low
order bits can be confusing when an exact representation isn't needed.

-hpa