genirq/generic_chip: Constify irq_generic_chip_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Tue, 30 Nov 2021 21:40:43 +0000 (22:40 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 30 Nov 2021 23:15:07 +0000 (00:15 +0100)
The only usage of irq_generic_chip_ops is to pass its address to
irq_domain_add_linear() which takes a pointer to const struct
irq_domain_ops. Make it const to allow the compiler to put it in
read-only memory.

[ tglx: Fixed subject prefix ]

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20211130214043.1257585-1-rikard.falkeborn@gmail.com
include/linux/irqdomain.h
kernel/irq/generic-chip.c

index 553da4899f5536570005c932786c055c7def5b90..d476405802e9772b437b24812b905fac77dcc38b 100644 (file)
@@ -131,7 +131,7 @@ struct irq_domain_ops {
 #endif
 };
 
-extern struct irq_domain_ops irq_generic_chip_ops;
+extern const struct irq_domain_ops irq_generic_chip_ops;
 
 struct irq_domain_chip_generic;
 
index 6f29bf4c85153ffaf55e2313be68a14ec729b481..f0862eb6b506ce1f665961a2f35a6451df902cef 100644 (file)
@@ -451,7 +451,7 @@ static void irq_unmap_generic_chip(struct irq_domain *d, unsigned int virq)
 
 }
 
-struct irq_domain_ops irq_generic_chip_ops = {
+const struct irq_domain_ops irq_generic_chip_ops = {
        .map    = irq_map_generic_chip,
        .unmap  = irq_unmap_generic_chip,
        .xlate  = irq_domain_xlate_onetwocell,