diff mbox series

[09/10] clk: sunxi-ng r40: Constify struct regmap_config

Message ID 20240703-clk-const-regmap-v1-9-7d15a0671d6f@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series clk: constify struct regmap_config | expand

Commit Message

Javier Carrasco July 3, 2024, 9:50 a.m. UTC
`sun8i_r40_ccu_regmap_config` is not modified and can be declared as
const to move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/clk/sunxi-ng/ccu-sun8i-r40.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andre Przywara July 3, 2024, 11:17 a.m. UTC | #1
On Wed, 03 Jul 2024 11:50:22 +0200
Javier Carrasco <javier.carrasco.cruz@gmail.com> wrote:

> `sun8i_r40_ccu_regmap_config` is not modified and can be declared as
> const to move its data to a read-only section.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>

Looks alright, we indeed don't change it, and the only user takes a const
pointer. Also the compiler seems happy.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
>  drivers/clk/sunxi-ng/ccu-sun8i-r40.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
> index 984ad3f76b18..2f51ceab8016 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
> @@ -1292,7 +1292,7 @@ static bool sun8i_r40_ccu_regmap_accessible_reg(struct device *dev,
>  	return false;
>  }
>  
> -static struct regmap_config sun8i_r40_ccu_regmap_config = {
> +static const struct regmap_config sun8i_r40_ccu_regmap_config = {
>  	.reg_bits	= 32,
>  	.val_bits	= 32,
>  	.reg_stride	= 4,
>
Chen-Yu Tsai July 10, 2024, 4:53 p.m. UTC | #2
On Wed, Jul 3, 2024 at 7:19 PM Andre Przywara <andre.przywara@arm.com> wrote:
>
> On Wed, 03 Jul 2024 11:50:22 +0200
> Javier Carrasco <javier.carrasco.cruz@gmail.com> wrote:
>
> > `sun8i_r40_ccu_regmap_config` is not modified and can be declared as
> > const to move its data to a read-only section.
> >
> > Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
>
> Looks alright, we indeed don't change it, and the only user takes a const
> pointer. Also the compiler seems happy.
>
> Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Acked-by: Chen-Yu Tsai <wens@csie.org>

Stephen, can you merge this one directly? It doesn't look like we'll
have any more stuff to send for this cycle.

ChenYu


> Cheers,
> Andre
>
> > ---
> >  drivers/clk/sunxi-ng/ccu-sun8i-r40.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
> > index 984ad3f76b18..2f51ceab8016 100644
> > --- a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
> > +++ b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
> > @@ -1292,7 +1292,7 @@ static bool sun8i_r40_ccu_regmap_accessible_reg(struct device *dev,
> >       return false;
> >  }
> >
> > -static struct regmap_config sun8i_r40_ccu_regmap_config = {
> > +static const struct regmap_config sun8i_r40_ccu_regmap_config = {
> >       .reg_bits       = 32,
> >       .val_bits       = 32,
> >       .reg_stride     = 4,
> >
>
Stephen Boyd July 10, 2024, 7:47 p.m. UTC | #3
Quoting Javier Carrasco (2024-07-03 02:50:22)
> `sun8i_r40_ccu_regmap_config` is not modified and can be declared as
> const to move its data to a read-only section.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---

Applied to clk-next
diff mbox series

Patch

diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
index 984ad3f76b18..2f51ceab8016 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
@@ -1292,7 +1292,7 @@  static bool sun8i_r40_ccu_regmap_accessible_reg(struct device *dev,
 	return false;
 }
 
-static struct regmap_config sun8i_r40_ccu_regmap_config = {
+static const struct regmap_config sun8i_r40_ccu_regmap_config = {
 	.reg_bits	= 32,
 	.val_bits	= 32,
 	.reg_stride	= 4,