Skip to content

Commit

Permalink
irq_domain: fix type mismatch in debugfs output format
Browse files Browse the repository at this point in the history
sizeof(void*) returns an unsigned long, but it was being used as a width parameter to a "%-*s" format string which requires an int.  On 64 bit platforms this causes a type mismatch:

    linux/kernel/irq/irqdomain.c:575: warning: field width should have type
    'int', but argument 6 has type 'long unsigned int'

This change casts the size to an int so printf gets the right data type.

Reported-by: Andreas Schwab <[email protected]>
Signed-off-by: Grant Likely <[email protected]>
Cc: David Daney <[email protected]>
  • Loading branch information
glikely committed Apr 12, 2012
1 parent ecca5c3 commit 5269a9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/irq/irqdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,8 @@ static int virq_debug_show(struct seq_file *m, void *private)
int i;

seq_printf(m, "%-5s %-7s %-15s %-*s %s\n", "irq", "hwirq",
"chip name", 2 * sizeof(void *) + 2, "chip data", "domain name");
"chip name", (int)(2 * sizeof(void *) + 2), "chip data",
"domain name");

for (i = 1; i < nr_irqs; i++) {
desc = irq_to_desc(i);
Expand Down

0 comments on commit 5269a9a

Please sign in to comment.