summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-12-10 20:25:44 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-12-15 16:19:31 +0100
commit501e2db67fa4264b517de5c7934e94cca89b3a1e (patch)
treedc656c09981d9fcaef2bd9cc6889d9e9e124c505 /include
parent26c19d0a8610fb233b31730fe26a31145f2d9796 (diff)
downloadlinux-stable-501e2db67fa4264b517de5c7934e94cca89b3a1e.tar.gz
linux-stable-501e2db67fa4264b517de5c7934e94cca89b3a1e.tar.bz2
linux-stable-501e2db67fa4264b517de5c7934e94cca89b3a1e.zip
genirq: Provide kstat_irqdesc_cpu()
Most users of kstat_irqs_cpu() have the irq descriptor already. No point in calling into the core code and looking it up once more. Use it in per_cpu_count_show() to start with. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20201210194043.362094758@linutronix.de
Diffstat (limited to 'include')
-rw-r--r--include/linux/irqdesc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 4a1d016716f4..891b323266df 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -113,6 +113,12 @@ static inline void irq_unlock_sparse(void) { }
extern struct irq_desc irq_desc[NR_IRQS];
#endif
+static inline unsigned int irq_desc_kstat_cpu(struct irq_desc *desc,
+ unsigned int cpu)
+{
+ return desc->kstat_irqs ? *per_cpu_ptr(desc->kstat_irqs, cpu) : 0;
+}
+
static inline struct irq_desc *irq_data_to_desc(struct irq_data *data)
{
return container_of(data->common, struct irq_desc, irq_common_data);