irqchip/apple-aic: Mark aic_info structs __initconst

Message ID 20221021235523.76585-1-konrad.dybcio@somainline.org
State New
Headers
Series irqchip/apple-aic: Mark aic_info structs __initconst |

Commit Message

Konrad Dybcio Oct. 21, 2022, 11:55 p.m. UTC
  These structs hold information used only at init time that never
gets modified, hence mark them __initconst.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 drivers/irqchip/irq-apple-aic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Konrad Dybcio Oct. 21, 2022, 11:57 p.m. UTC | #1
On 22.10.2022 01:55, Konrad Dybcio wrote:
> These structs hold information used only at init time that never
> gets modified, hence mark them __initconst.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
> ---
Forgot to add:

Suggested-by: Marc Zyngier <maz@kernel.org>


Konrad
>  drivers/irqchip/irq-apple-aic.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c
> index 1c2813ad8bbe..ae3437f03e6c 100644
> --- a/drivers/irqchip/irq-apple-aic.c
> +++ b/drivers/irqchip/irq-apple-aic.c
> @@ -248,14 +248,14 @@ struct aic_info {
>  	bool fast_ipi;
>  };
>  
> -static const struct aic_info aic1_info = {
> +static const struct aic_info aic1_info __initconst = {
>  	.version	= 1,
>  
>  	.event		= AIC_EVENT,
>  	.target_cpu	= AIC_TARGET_CPU,
>  };
>  
> -static const struct aic_info aic1_fipi_info = {
> +static const struct aic_info aic1_fipi_info __initconst = {
>  	.version	= 1,
>  
>  	.event		= AIC_EVENT,
> @@ -264,7 +264,7 @@ static const struct aic_info aic1_fipi_info = {
>  	.fast_ipi	= true,
>  };
>  
> -static const struct aic_info aic2_info = {
> +static const struct aic_info aic2_info __initconst = {
>  	.version	= 2,
>  
>  	.irq_cfg	= AIC2_IRQ_CFG,
  
Eric Curtin Oct. 22, 2022, 1:49 p.m. UTC | #2
On Sat, 22 Oct 2022 at 01:04, Konrad Dybcio
<konrad.dybcio@somainline.org> wrote:
>
>
>
> On 22.10.2022 01:55, Konrad Dybcio wrote:
> > These structs hold information used only at init time that never
> > gets modified, hence mark them __initconst.
> >
> > Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>

Reviewed-by: Eric Curtin <ecurtin@redhat.com>

> > ---
> Forgot to add:
>
> Suggested-by: Marc Zyngier <maz@kernel.org>
>
>
> Konrad
> >  drivers/irqchip/irq-apple-aic.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c
> > index 1c2813ad8bbe..ae3437f03e6c 100644
> > --- a/drivers/irqchip/irq-apple-aic.c
> > +++ b/drivers/irqchip/irq-apple-aic.c
> > @@ -248,14 +248,14 @@ struct aic_info {
> >       bool fast_ipi;
> >  };
> >
> > -static const struct aic_info aic1_info = {
> > +static const struct aic_info aic1_info __initconst = {
> >       .version        = 1,
> >
> >       .event          = AIC_EVENT,
> >       .target_cpu     = AIC_TARGET_CPU,
> >  };
> >
> > -static const struct aic_info aic1_fipi_info = {
> > +static const struct aic_info aic1_fipi_info __initconst = {
> >       .version        = 1,
> >
> >       .event          = AIC_EVENT,
> > @@ -264,7 +264,7 @@ static const struct aic_info aic1_fipi_info = {
> >       .fast_ipi       = true,
> >  };
> >
> > -static const struct aic_info aic2_info = {
> > +static const struct aic_info aic2_info __initconst = {
> >       .version        = 2,
> >
> >       .irq_cfg        = AIC2_IRQ_CFG,
>
  

Patch

diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c
index 1c2813ad8bbe..ae3437f03e6c 100644
--- a/drivers/irqchip/irq-apple-aic.c
+++ b/drivers/irqchip/irq-apple-aic.c
@@ -248,14 +248,14 @@  struct aic_info {
 	bool fast_ipi;
 };
 
-static const struct aic_info aic1_info = {
+static const struct aic_info aic1_info __initconst = {
 	.version	= 1,
 
 	.event		= AIC_EVENT,
 	.target_cpu	= AIC_TARGET_CPU,
 };
 
-static const struct aic_info aic1_fipi_info = {
+static const struct aic_info aic1_fipi_info __initconst = {
 	.version	= 1,
 
 	.event		= AIC_EVENT,
@@ -264,7 +264,7 @@  static const struct aic_info aic1_fipi_info = {
 	.fast_ipi	= true,
 };
 
-static const struct aic_info aic2_info = {
+static const struct aic_info aic2_info __initconst = {
 	.version	= 2,
 
 	.irq_cfg	= AIC2_IRQ_CFG,