Input - constify read-only struct regmap_config
Subsystems (3)
cover Input - constify read-only struct regmap_config
This series adds the const modifier to the remaining regmap_config structs in the input subsystem that are effectively used as const (i.e., only read after their declaration), but kept as writtable data.
---
Javier Carrasco (2):
Input: qt1050 - constify struct regmap_config
Input: fsl-imx25-tcq - constify struct regmap_config
drivers/input/keyboard/qt1050.c | 2 +- drivers/input/touchscreen/fsl-imx25-tcq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
---
base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233
change-id: 20240705-input-const-regmap_config-46d2fb3110bd
Best regards,
Signature · 1 line
Javier Carrasco <[email protected]>
PATCH 1/2 Input: qt1050 - constify struct regmap_config
qt1050_regmap_config is not modified and can be declared as const to move its data to a read-only section.
--- drivers/input/keyboard/qt1050.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/qt1050.c +1 -1
@@ -208,7 +208,7 @@ static const struct regmap_access_table qt1050_writeable_table = { .n_yes_ranges = ARRAY_SIZE(qt1050_writeable_ranges), }; -static struct regmap_config qt1050_regmap_config = { +static const struct regmap_config qt1050_regmap_config = { .reg_bits =8 , .val_bits =8 , .max_register =QT1050_RES_CAL ,
Signature · 1 line
2.40.1
PATCH 2/2 Input: fsl-imx25-tcq - constify struct regmap_config
In reply to Javier Carrascomx25_tcq_regconfig is not modified and can be declared as const to move its data to a read-only section.
--- drivers/input/touchscreen/fsl-imx25-tcq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/fsl-imx25-tcq.c +1 -1
@@ -38,7 +38,7 @@ struct mx25_tcq_priv {struct device *dev; }; -static struct regmap_config mx25_tcq_regconfig = { +static const struct regmap_config mx25_tcq_regconfig = { .fast_io = true, .max_register =0x5c , .reg_bits =32 ,
Signature · 1 line
2.40.1
Dmitry Torokhov
maintainerQuoted 5 lines · Javier Carrasco
This series adds the const modifier to the remaining
regmap_configstructs in the input subsystem that are effectively used as const (i.e., only read after their declaration), but kept as writtable data.Signed-off-by Javier Carrasco <[email protected]>
Quoted 8 lines
---
Javier Carrasco (2):
Input: qt1050 - constify structregmap_config
Input: fsl-imx25-tcq - constify structregmap_configdrivers/input/keyboard/qt1050.c | 2 +- drivers/input/touchscreen/fsl-imx25-tcq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Applied the lot, thank you.
Signature · 1 line
Dmitry