Skip to content

Commit a74ce59

Browse files
legoatermpe
authored andcommitted
powerpc/xive: Drop check on irq_data in xive_core_debug_show()
When looping on IRQ descriptor, irq_data is always valid. Fixes: 930914b ("powerpc/xive: Add a debugfs file to dump internal XIVE state") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Cédric Le Goater <[email protected]> Reviewed-by: Greg Kurz <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5159d98 commit a74ce59

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

arch/powerpc/sysdev/xive/common.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,8 @@ static void xive_debug_show_irq(struct seq_file *m, struct irq_data *d)
16111611
u32 target;
16121612
u8 prio;
16131613
u32 lirq;
1614+
struct xive_irq_data *xd;
1615+
u64 val;
16141616

16151617
rc = xive_ops->get_irq_config(hw_irq, &target, &prio, &lirq);
16161618
if (rc) {
@@ -1621,17 +1623,14 @@ static void xive_debug_show_irq(struct seq_file *m, struct irq_data *d)
16211623
seq_printf(m, "IRQ 0x%08x : target=0x%x prio=%02x lirq=0x%x ",
16221624
hw_irq, target, prio, lirq);
16231625

1624-
if (d) {
1625-
struct xive_irq_data *xd = irq_data_get_irq_handler_data(d);
1626-
u64 val = xive_esb_read(xd, XIVE_ESB_GET);
1627-
1628-
seq_printf(m, "flags=%c%c%c PQ=%c%c",
1629-
xd->flags & XIVE_IRQ_FLAG_STORE_EOI ? 'S' : ' ',
1630-
xd->flags & XIVE_IRQ_FLAG_LSI ? 'L' : ' ',
1631-
xd->flags & XIVE_IRQ_FLAG_H_INT_ESB ? 'H' : ' ',
1632-
val & XIVE_ESB_VAL_P ? 'P' : '-',
1633-
val & XIVE_ESB_VAL_Q ? 'Q' : '-');
1634-
}
1626+
xd = irq_data_get_irq_handler_data(d);
1627+
val = xive_esb_read(xd, XIVE_ESB_GET);
1628+
seq_printf(m, "flags=%c%c%c PQ=%c%c",
1629+
xd->flags & XIVE_IRQ_FLAG_STORE_EOI ? 'S' : ' ',
1630+
xd->flags & XIVE_IRQ_FLAG_LSI ? 'L' : ' ',
1631+
xd->flags & XIVE_IRQ_FLAG_H_INT_ESB ? 'H' : ' ',
1632+
val & XIVE_ESB_VAL_P ? 'P' : '-',
1633+
val & XIVE_ESB_VAL_Q ? 'Q' : '-');
16351634
seq_puts(m, "\n");
16361635
}
16371636

0 commit comments

Comments
 (0)