Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1317273

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

From James Bottomley <James.Bottomley@HansenPartnership.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/4] x86/efi: print size in binary units in efi_print_memmap
Date 2016-01-25 21:20 +0100
Message-ID <qUVMf-PD-15@gated-at.bofh.it> (permalink)
References (3 earlier) <qUTKq-7UQ-3@gated-at.bofh.it> <qUUwO-8gR-7@gated-at.bofh.it> <qUUZQ-gp-23@gated-at.bofh.it> <qUVjc-pt-5@gated-at.bofh.it> <qUVCz-M7-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@hansenpartnership.com> wrote:
> > On Mon, 2016-01-25 at 21:28 +0200, Andy Shevchenko wrote:
> > > On Mon, Jan 25, 2016 at 8:56 PM, James Bottomley
> > > <James.Bottomley@hansenpartnership.com> wrote:
> > > > On Mon, 2016-01-25 at 18:02 +0000, Elliott, Robert (Persistent
> > > > Memory)
> > > > wrote:
> > > 
> > > >  Using ffs leads to precision runaway
> > > 
> > > How exactly?!
> > 
> > Off by one.  A size of 0xffffffffffffffff prints
> > 18446744073709551615 B
> > rather than 20 GiB.
> 
> Because it's not a 20 GiB. It's exactly 20 GiB - 1 B.
> 
> AFAIU, the intention was to show _exact_ size.

I think that's a bad idea:  The range shows you the exact stuff in hex,
so all the information is present if you want precision.  What's
printed in brackets is for humans to read.  I'd have to reach for a
calculator to work out that  18446744073709551615 is actually around 20
GiB.

James

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 3/4] x86/efi: print size in binary units in efi_print_memmap Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-23 16:00 +0100
  Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-01-23 17:50 +0100
    Re: [PATCH v3 3/4] x86/efi: print size in binary units in efi_print_memmap Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-01-23 18:20 +0100
      Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-01-23 19:10 +0100
        Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-25 09:40 +0100
          Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-01-25 16:30 +0100
      Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-01-23 19:20 +0100
        Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-01-23 21:40 +0100
          Re: [PATCH v3 3/4] x86/efi: print size in binary units in efi_print_memmap "H. Peter Anvin" <hpa@zytor.com> - 2016-01-23 21:50 +0100
    RE: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap "Elliott, Robert (Persistent Memory)" <elliott@hpe.com> - 2016-01-25 19:10 +0100
      Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-01-25 20:00 +0100
        Re: [PATCH v3 3/4] x86/efi: print size in binary units in efi_print_memmap Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-01-25 20:30 +0100
          Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-01-25 20:50 +0100
            Re: [PATCH v3 3/4] x86/efi: print size in binary units in efi_print_memmap Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-01-25 21:10 +0100
              Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-01-25 21:20 +0100
              RE: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap "Elliott, Robert (Persistent Memory)" <elliott@hpe.com> - 2016-01-25 21:40 +0100
                Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap Matt Fleming <matt@codeblueprint.co.uk> - 2016-01-26 13:00 +0100
                Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-26 13:00 +0100
              Re: [PATCH v3 3/4] x86/efi: print size in binary units in  efi_print_memmap James Bottomley <James.Bottomley@HansenPartnership.com> - 2016-01-25 21:50 +0100

csiph-web