[PATCH 4/5] irqchip: Constify some irq_desc_get_chip() usage

Christophe JAILLET
2024-11-17T09:50:13Z

When irq_desc_get_chip() will return a const struct irq_chip, the const
qualifier will be needed for local variables that store the return value of
this function.

So start to add some of these const qualifiers.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only
---
kernel/irq/chip.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index eca39c4dd094..d3acccf7e2e2 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -751,7 +751,7 @@ EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
*/
void handle_fasteoi_nmi(struct irq_desc *desc)
{
- struct irq_chip *chip = irq_desc_get_chip(desc);
+ const struct irq_chip *chip = irq_desc_get_chip(desc);
struct irqaction *action = desc->action;
unsigned int irq = irq_desc_get_irq(desc);
irqreturn_t res;
@@ -849,7 +849,7 @@ EXPORT_SYMBOL(handle_edge_irq);
*/
void handle_edge_eoi_irq(struct irq_desc *desc)
{
- struct irq_chip *chip = irq_desc_get_chip(desc);
+ const struct irq_chip *chip = irq_desc_get_chip(desc);

raw_spin_lock(&desc->lock);

@@ -894,7 +894,7 @@ void handle_edge_eoi_irq(struct irq_desc *desc)
*/
void handle_percpu_irq(struct irq_desc *desc)
{
- struct irq_chip *chip = irq_desc_get_chip(desc);
+ const struct irq_chip *chip = irq_desc_get_chip(desc);

/*
* PER CPU interrupts are not serialized. Do not touch
@@ -924,7 +924,7 @@ void handle_percpu_irq(struct irq_desc *desc)
*/
void handle_percpu_devid_irq(struct irq_desc *desc)
{
- struct irq_chip *chip = irq_desc_get_chip(desc);
+ const struct irq_chip *chip = irq_desc_get_chip(desc);
struct irqaction *action = desc->action;
unsigned int irq = irq_desc_get_irq(desc);
irqreturn_t res;
@@ -967,7 +967,7 @@ void handle_percpu_devid_irq(struct irq_desc *desc)
*/
void handle_percpu_devid_fasteoi_nmi(struct irq_desc *desc)
{
- struct irq_chip *chip = irq_desc_get_chip(desc);
+ const struct irq_chip *chip = irq_desc_get_chip(desc);
struct irqaction *action = desc->action;
unsigned int irq = irq_desc_get_irq(desc);
irqreturn_t res;
--
2.47.0