net: stmmac: Pad ring number with zeroes in display_ring()
authorFlorian Fainelli <f.fainelli@gmail.com>
Sat, 30 Dec 2017 03:56:32 +0000 (19:56 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Jan 2018 02:54:56 +0000 (21:54 -0500)
Make the printing of the ring number consistent and properly aligned by
padding the ring number with up to 3 zeroes, which covers the maximum
ring size. This makes it a lot easier to see outliers in debug prints.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
drivers/net/ethernet/stmicro/stmmac/enh_desc.c
drivers/net/ethernet/stmicro/stmmac/norm_desc.c

index 7e089bf906b4f316034403f9a44fbfd191ee09eb..2fd8456999f691e8c69d14ff19f67e129d745409 100644 (file)
@@ -406,7 +406,7 @@ static void dwmac4_display_ring(void *head, unsigned int size, bool rx)
        pr_info("%s descriptor ring:\n", rx ? "RX" : "TX");
 
        for (i = 0; i < size; i++) {
-               pr_info("%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
+               pr_info("%03d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
                        i, (unsigned int)virt_to_phys(p),
                        le32_to_cpu(p->des0), le32_to_cpu(p->des1),
                        le32_to_cpu(p->des2), le32_to_cpu(p->des3));
index 2a828a31281423082995bc332ec51a3f20989804..b47cb5c4da5134978d33e5ddfde88abf29adbe7d 100644 (file)
@@ -428,7 +428,7 @@ static void enh_desc_display_ring(void *head, unsigned int size, bool rx)
                u64 x;
 
                x = *(u64 *)ep;
-               pr_info("%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
+               pr_info("%03d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
                        i, (unsigned int)virt_to_phys(ep),
                        (unsigned int)x, (unsigned int)(x >> 32),
                        ep->basic.des2, ep->basic.des3);
index db4cee57bb2465eb98fe38cb947624e779da4673..ebd9e5e00f1619c9d09718a2d13163ecf3596687 100644 (file)
@@ -288,7 +288,7 @@ static void ndesc_display_ring(void *head, unsigned int size, bool rx)
                u64 x;
 
                x = *(u64 *)p;
-               pr_info("%d [0x%x]: 0x%x 0x%x 0x%x 0x%x",
+               pr_info("%03d [0x%x]: 0x%x 0x%x 0x%x 0x%x",
                        i, (unsigned int)virt_to_phys(p),
                        (unsigned int)x, (unsigned int)(x >> 32),
                        p->des2, p->des3);