[PATCH 2/3] hwmon: (tmp513) Constify struct regmap_config

Javier Carrasco posted 3 patches 1 year, 5 months ago
[PATCH 2/3] hwmon: (tmp513) Constify struct regmap_config
Posted by Javier Carrasco 1 year, 5 months ago
`tmp51x_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/hwmon/tmp513.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
index ea6f4416c124..926d28cd3fab 100644
--- a/drivers/hwmon/tmp513.c
+++ b/drivers/hwmon/tmp513.c
@@ -159,7 +159,7 @@ static const u8 TMP51X_CURR_INPUT[2] = {
 	TMP51X_BUS_CURRENT_RESULT
 };
 
-static struct regmap_config tmp51x_regmap_config = {
+static const struct regmap_config tmp51x_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 16,
 	.max_register = TMP51X_MAX_REGISTER_ADDR,

-- 
2.40.1
Re: [PATCH 2/3] hwmon: (tmp513) Constify struct regmap_config
Posted by Guenter Roeck 1 year, 5 months ago
On Tue, Jul 02, 2024 at 12:09:31PM +0200, Javier Carrasco wrote:
> `tmp51x_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.

Thanks,
Guenter