[U-Boot] [PATCH] cmd: pci: Adjust display of digits for 64bit address and size

Bin Meng bmeng.cn at gmail.com
Fri Aug 23 06:09:41 UTC 2019


Hi Kunihiko,

On Fri, Aug 23, 2019 at 1:40 PM Kunihiko Hayashi
<hayashi.kunihiko at socionext.com> wrote:
>
> Hi Bin,
>
> On Fri, 23 Aug 2019 11:43:55 +0800 <bmeng.cn at gmail.com> wrote:
>
> > Hi Kunihiko,
> >
> > On Fri, Aug 23, 2019 at 9:57 AM Kunihiko Hayashi
> > <hayashi.kunihiko at socionext.com> wrote:
> > >
> > > The command "pci bar" and "pci region" display the address and size in
> > > 16 characters including "0x", so the command can only display
> > > 14 hexadecimal digits if the number of digits in the address and size is
> > > less than 14.
> > >
> > >     ID   Base                Size                Width  Type
> > >     ----------------------------------------------------------
> > >      0   0x00000020000000  0x00000000100000  64     MEM   Prefetchable
> > >      1   0xffff000080000000  0x00000000100000  64     MEM   Prefetchable
> >
> > I am not sure why the ID 0 line has 14 digits while the ID 1 line has 16 digits.
> >
> > Shouldn't both lines be either 14 digits so that's what you are fixing
> > in this patch?
>
> The original format is "%#016llx".
> The base address of ID 1, "0xffff000080000000", is greater than
> 16 characters. So the result value is displayed as it is in 16 digits.
>
> However, the other values are less than 16 characters, and the values are
> zero padded. The padded values including "0x" are displayed in 16 characters.
> As a result, the values are displayed in 14 digits.
>
> After applying this patch, the values including "0x" are displayed in
> 18 characters, so the values are always displayed in 16 digits.
>

Ah, I missed that. Thanks.
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>

Regards,
Bin


More information about the U-Boot mailing list