diff mbox series

irqchip/sifive-plic: Make struct irq_chip const

Message ID 20220624175639.2677-1-prabhakar.mahadev-lad.rj@bp.renesas.com (mailing list archive)
State Awaiting Upstream
Delegated to: Geert Uytterhoeven
Headers show
Series irqchip/sifive-plic: Make struct irq_chip const | expand

Commit Message

Lad Prabhakar June 24, 2022, 5:56 p.m. UTC
These should be const, so make it so.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/irqchip/irq-sifive-plic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Palmer Dabbelt Aug. 11, 2022, 4:53 p.m. UTC | #1
On Fri, 24 Jun 2022 10:56:39 PDT (-0700), prabhakar.mahadev-lad.rj@bp.renesas.com wrote:
> These should be const, so make it so.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  drivers/irqchip/irq-sifive-plic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
> index bb87e4c3b88e..173446cc9204 100644
> --- a/drivers/irqchip/irq-sifive-plic.c
> +++ b/drivers/irqchip/irq-sifive-plic.c
> @@ -176,7 +176,7 @@ static void plic_irq_eoi(struct irq_data *d)
>  	}
>  }
>
> -static struct irq_chip plic_chip = {
> +static const struct irq_chip plic_chip = {
>  	.name		= "SiFive PLIC",
>  	.irq_mask	= plic_irq_mask,
>  	.irq_unmask	= plic_irq_unmask,

Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>

Not sure if this got picked up somewhere, but it looks fine to me.
Marc Zyngier Aug. 11, 2022, 5:19 p.m. UTC | #2
On 2022-08-11 17:53, Palmer Dabbelt wrote:
> On Fri, 24 Jun 2022 10:56:39 PDT (-0700),
> prabhakar.mahadev-lad.rj@bp.renesas.com wrote:
>> These should be const, so make it so.
>> 
>> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>> ---
>>  drivers/irqchip/irq-sifive-plic.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/irqchip/irq-sifive-plic.c 
>> b/drivers/irqchip/irq-sifive-plic.c
>> index bb87e4c3b88e..173446cc9204 100644
>> --- a/drivers/irqchip/irq-sifive-plic.c
>> +++ b/drivers/irqchip/irq-sifive-plic.c
>> @@ -176,7 +176,7 @@ static void plic_irq_eoi(struct irq_data *d)
>>  	}
>>  }
>> 
>> -static struct irq_chip plic_chip = {
>> +static const struct irq_chip plic_chip = {
>>  	.name		= "SiFive PLIC",
>>  	.irq_mask	= plic_irq_mask,
>>  	.irq_unmask	= plic_irq_unmask,
> 
> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
> 
> Not sure if this got picked up somewhere, but it looks fine to me.

It probably needs respinning (the PLIC code has evolved a bit since).

         M.
diff mbox series

Patch

diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index bb87e4c3b88e..173446cc9204 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -176,7 +176,7 @@  static void plic_irq_eoi(struct irq_data *d)
 	}
 }
 
-static struct irq_chip plic_chip = {
+static const struct irq_chip plic_chip = {
 	.name		= "SiFive PLIC",
 	.irq_mask	= plic_irq_mask,
 	.irq_unmask	= plic_irq_unmask,