Re: [PATCH v3 3/4] x86/efi: print size in binary units in efi_print_memmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2016-01-25 at 22:01 +0200, Andy Shevchenko wrote:
> On Mon, Jan 25, 2016 at 9:45 PM, James Bottomley
> <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > On Mon, 2016-01-25 at 21:28 +0200, Andy Shevchenko wrote:
> > > Also, in one version I tried to convert couple of other users
> > > which
> > > are using only KM (in general whatever range it would be) units.
> > > Any
> > > ideas how to modify to support them?
> > 
> > You mean units in odd increments of 6 digits (so K, M, T ...)? no. 
> >  The logarithmic reduction is done to the base of the unit 
> > increment (1000 or 1024) so it doesn't really fit this case and it 
> > would be hard to adjust because we don't have enough precision in 
> > the remainder.  However, unless there's a huge need to keep it, I'd 
> > just fit to the closest 3 digit increment and then everything would
> > work.
> 
> KM case:
> K) if 1 MiB > value >= 0 — prints in KiB
> M) if ∞ > value >= 1 MiB — prints in MiB.

Actually there is a way to do this: add a fixed precision argument that
would stop the logarithmic reduction when the desired precision were
reached.  You'd still have to do the precision discrimination in the
call, so something like

num > 1Mib ? call for precision of 6 : call for precision of 3

James

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux