Skip to content

Commit 4946f15

Browse files
rikardfalkebornKAGA-KOKO
authored andcommitted
genirq/generic_chip: Constify irq_generic_chip_ops
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d58071a commit 4946f15

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/linux/irqdomain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct irq_domain_ops {
131131
#endif
132132
};
133133

134-
extern struct irq_domain_ops irq_generic_chip_ops;
134+
extern const struct irq_domain_ops irq_generic_chip_ops;
135135

136136
struct irq_domain_chip_generic;
137137

kernel/irq/generic-chip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ static void irq_unmap_generic_chip(struct irq_domain *d, unsigned int virq)
451451

452452
}
453453

454-
struct irq_domain_ops irq_generic_chip_ops = {
454+
const struct irq_domain_ops irq_generic_chip_ops = {
455455
.map = irq_map_generic_chip,
456456
.unmap = irq_unmap_generic_chip,
457457
.xlate = irq_domain_xlate_onetwocell,

0 commit comments

Comments
 (0)