All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iqrdomain: Improve formatting in debugfs.
@ 2012-04-10  0:06 David Daney
  2012-04-11  7:03 ` Grant Likely
  0 siblings, 1 reply; 11+ messages in thread
From: David Daney @ 2012-04-10  0:06 UTC (permalink / raw)
  To: Grant Likely, Benjamin Herrenschmidt, Thomas Gleixner
  Cc: linux-kernel, David Daney

From: David Daney <david.daney@cavium.com>

The irq_domain_mapping file has some interesting output when chip_data
contains leading zeros:

virq   hwirq    chip name        chip data           domain name
.
.
.
  103  0x00000  CIU2-W           0x 5e0000000000000  none
  104  0x00000  CIU2-W           0x 5f0000000000000  none
  105  0x00000  CIU2-M           0x          (null)  none
  113  0x00000  CIU2-E           0x1080000000000000  none
.
.
.

I think there should be no space in there between the "0x" and the
rest.  Also the '(null)' entry doesn't make much sense at all with a
"0x".

Instead I suggest:
.
.
.
  103  0x00000  CIU2-W           0x05e0000000000000  none
  104  0x00000  CIU2-W           0x05f0000000000000  none
  105  0x00000  CIU2-M           0x0000000000000000  none
  113  0x00000  CIU2-E           0x1080000000000000  none
.
.
.

This patch also prints the "chip data" as an 8 character wide number
for 32-bit kernels, instead of the 16 characters wide in the 64-bit
case.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 kernel/irq/irqdomain.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 481f2da..83474bf 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -642,9 +642,10 @@ static int virq_debug_show(struct seq_file *m, void *private)
 	static const char none[] = "none";
 	void *data;
 	int i;
+	int ptr_width = sizeof(void *) * 2;
 
-	seq_printf(m, "%-5s  %-7s  %-15s  %-18s  %s\n", "virq", "hwirq",
-		      "chip name", "chip data", "domain name");
+	seq_printf(m, "%-5s  %-7s  %-15s  %-*s  %s\n", "virq", "hwirq",
+		   "chip name", ptr_width + 2, "chip data", "domain name");
 
 	for (i = 1; i < nr_irqs; i++) {
 		desc = irq_to_desc(i);
@@ -667,7 +668,8 @@ static int virq_debug_show(struct seq_file *m, void *private)
 			seq_printf(m, "%-15s  ", p);
 
 			data = irq_desc_get_chip_data(desc);
-			seq_printf(m, "0x%16p  ", data);
+			seq_printf(m, "0x%0*lx  ",
+				   ptr_width, (unsigned long)data);
 
 			if (desc->irq_data.domain && desc->irq_data.domain->of_node)
 				p = desc->irq_data.domain->of_node->full_name;
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-04-16 22:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-10  0:06 [PATCH] iqrdomain: Improve formatting in debugfs David Daney
2012-04-11  7:03 ` Grant Likely
2012-04-11  9:16   ` Andreas Schwab
2012-04-11 14:52     ` Grant Likely
2012-04-11 14:57       ` Grant Likely
2012-04-16 22:01       ` Andreas Schwab
2012-04-16 22:25         ` Grant Likely
2012-04-11 15:33   ` David Daney
2012-04-12 19:20   ` Andreas Schwab
2012-04-12 20:38     ` David Daney
2012-04-12 20:46       ` Grant Likely

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.