[tip: irq/core] parisc: Remove unnecessary NULL check of the kstat_irqs field

From: tip-bot2 for Radu Rendec

Date: Tue Jul 07 2026 - 15:39:58 EST


The following commit has been merged into the irq/core branch of tip:

Commit-ID: 2c27d9b154743eb113e643680b5ce2f8a51647a4
Gitweb: https://git.kernel.org/tip/2c27d9b154743eb113e643680b5ce2f8a51647a4
Author: Radu Rendec <radu@xxxxxxxxxx>
AuthorDate: Sun, 05 Jul 2026 17:09:51 -04:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Tue, 07 Jul 2026 21:36:19 +02:00

parisc: Remove unnecessary NULL check of the kstat_irqs field

The kstat_irqs field of struct irq_desc is used to store a per-cpu count
of interrupt events. It is initialized in init_desc(), along with all
the other fields in struct irq_desc that need explicit initialization,
and therefore it's always available (non-NULL) for any valid interrupt
descriptor.

On parisc, CONFIG_SPARSE_IRQ is disabled, interrupt descriptors are
allocated statically in the irq_desc[] array, and kstat_irqs is
initialized implicitly to NULL. The kstat_irqs field is initialized
later, for all descriptors, via start_kernel() -> early_irq_init() ->
init_desc().

smp_boot_one_cpu() is used only for CPU hotplugging. On a SMP system,
the boot CPU initializes the interrupt descriptors as described above,
and smp_boot_one_cpu() is called later, for the secondary CPU(s).

A previous change made similar changes across the generic interrupt code in
kernel/irq/irqdesc.c, and provides a more detailed explanation of why
kstat_irqs is guaranteed to be non-NULL.

Signed-off-by: Radu Rendec <radu@xxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Link: https://patch.msgid.link/20260705210951.2717741-3-radu@xxxxxxxxxx
---
arch/parisc/kernel/smp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index b2d12ab..36be17e 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -343,7 +343,7 @@ static int smp_boot_one_cpu(int cpuid, struct task_struct *idle)
for (i = 0; i < NR_IRQS; i++) {
struct irq_desc *desc = irq_to_desc(i);

- if (desc && desc->kstat_irqs)
+ if (desc)
*per_cpu_ptr(desc->kstat_irqs, cpuid) = (struct irqstat) { };
}
#endif