Commit 54058877 authored by Adrian Huang's avatar Adrian Huang Committed by Thomas Gleixner
Browse files

genirq/proc: Simplify irqdesc::kstat_irqs handling further



Interrupts which have no action and chained interrupts can be
ignored due to the following reasons (as per tglx's comment):

  1) Interrupts which have no action are completely uninteresting as
     there is no real information attached.

  2) Chained interrupts do not have a count at all.

So there is no point to evaluate the number of accounted interrupts before
checking for non-requested or chained interrupts.

Remove the any_count logic and simply check whether the interrupt
descriptor has the kstat_irqs member populated.

[ tglx: Adapted to upstream changes ]

Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAdrian Huang <ahuang12@lenovo.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarJiwei Sun <sunjw10@lenovo.com>
Link: https://lore.kernel.org/r/20240515100632.1419-1-ahuang12@lenovo.com
Link: https://lore.kernel.org/lkml/87h6f0knau.ffs@tglx/
parent c3f38fa6
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -461,10 +461,10 @@ int show_interrupts(struct seq_file *p, void *v)
{
	static int prec;

	unsigned long flags, any_count = 0;
	int i = *(loff_t *) v, j;
	struct irqaction *action;
	struct irq_desc *desc;
	unsigned long flags;

	if (i > ACTUAL_NR_IRQS)
		return 0;
@@ -488,10 +488,7 @@ int show_interrupts(struct seq_file *p, void *v)
	if (!desc || irq_settings_is_hidden(desc))
		goto outsparse;

	if (desc->kstat_irqs)
		any_count = kstat_irqs_desc(desc, cpu_online_mask);

	if ((!desc->action || irq_desc_is_chained(desc)) && !any_count)
	if (!desc->action || irq_desc_is_chained(desc) || !desc->kstat_irqs)
		goto outsparse;

	seq_printf(p, "%*d: ", prec, i);