From patchwork Fri Aug 23 01:56:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 1151908 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46F4KH1X2Jz9sND for ; Fri, 23 Aug 2019 11:57:21 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id AB515C220DB; Fri, 23 Aug 2019 01:57:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 38011C22070; Fri, 23 Aug 2019 01:57:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 89455C22070; Fri, 23 Aug 2019 01:57:08 +0000 (UTC) Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lists.denx.de (Postfix) with ESMTP id 79173C22047 for ; Fri, 23 Aug 2019 01:57:07 +0000 (UTC) Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 23 Aug 2019 10:57:04 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 9099C605F8; Fri, 23 Aug 2019 10:57:04 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Fri, 23 Aug 2019 10:57:04 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan.css.socionext.com (Postfix) with ESMTP id 6E7161A04FB; Fri, 23 Aug 2019 10:57:04 +0900 (JST) From: Kunihiko Hayashi To: u-boot@lists.denx.de Date: Fri, 23 Aug 2019 10:56:55 +0900 Message-Id: <1566525415-15487-1-git-send-email-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Yehuda Yitschak Subject: [U-Boot] [PATCH] cmd: pci: Adjust display of digits for 64bit address and size X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 The 64-bit address and size should be displayed in 18(= 16+2) digits, so this patch adjusts them. Cc: Yehuda Yitschak Cc: Simon Glass Signed-off-by: Kunihiko Hayashi Reviewed-by: Bin Meng --- cmd/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/pci.c b/cmd/pci.c index 2c5ee2a..0043471 100644 --- a/cmd/pci.c +++ b/cmd/pci.c @@ -148,7 +148,7 @@ int pci_bar_show(struct udevice *dev) if ((!is_64 && size_low) || (is_64 && size)) { size = ~size + 1; - printf(" %d %#016llx %#016llx %d %s %s\n", + printf(" %d %#018llx %#018llx %d %s %s\n", bar_id, (unsigned long long)base, (unsigned long long)size, is_64 ? 64 : 32, is_io ? "I/O" : "MEM", @@ -629,10 +629,10 @@ static void pci_show_regions(struct udevice *bus) return; } - printf("# %-16s %-16s %-16s %s\n", "Bus start", "Phys start", "Size", + printf("# %-18s %-18s %-18s %s\n", "Bus start", "Phys start", "Size", "Flags"); for (i = 0, reg = hose->regions; i < hose->region_count; i++, reg++) { - printf("%d %#016llx %#016llx %#016llx ", i, + printf("%d %#018llx %#018llx %#018llx ", i, (unsigned long long)reg->bus_start, (unsigned long long)reg->phys_start, (unsigned long long)reg->size);