[PATCH 1/4] net: dsa: qca8k: constify struct regmap_config

Javier Carrasco posted 4 patches 1 year, 7 months ago
[PATCH 1/4] net: dsa: qca8k: constify struct regmap_config
Posted by Javier Carrasco 1 year, 7 months ago
`qca8k_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/net/dsa/qca/qca8k-8xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
index b3c27cf538e8..f8d8c70642c4 100644
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
@@ -565,7 +565,7 @@ qca8k_regmap_update_bits(void *ctx, uint32_t reg, uint32_t mask, uint32_t write_
 	return qca8k_regmap_update_bits_mii(priv, reg, mask, write_val);
 }
 
-static struct regmap_config qca8k_regmap_config = {
+static const struct regmap_config qca8k_regmap_config = {
 	.reg_bits = 16,
 	.val_bits = 32,
 	.reg_stride = 4,

-- 
2.40.1
Re: [PATCH 1/4] net: dsa: qca8k: constify struct regmap_config
Posted by Vladimir Oltean 1 year, 7 months ago
On Wed, Jul 03, 2024 at 11:46:33PM +0200, Javier Carrasco wrote:
> `qca8k_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>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>