diff mbox series

[2/4] net: ti: icss-iep: constify struct regmap_config

Message ID 20240703-net-const-regmap-v1-2-ff4aeceda02c@gmail.com (mailing list archive)
State New
Headers show
Series net: constify struct regmap_bus/regmap_config | expand

Commit Message

Javier Carrasco July 3, 2024, 9:46 p.m. UTC
`am654_icss_iep_regmap_config` is only assigned to a pointer that passes
the data as read-only.

Add the const modifier to the struct and pointer to move the data to a
read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/net/ethernet/ti/icssg/icss_iep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Roger Quadros July 4, 2024, 2:42 p.m. UTC | #1
On 04/07/2024 00:46, Javier Carrasco wrote:
> `am654_icss_iep_regmap_config` is only assigned to a pointer that passes
> the data as read-only.
> 
> Add the const modifier to the struct and pointer to move the data to a
> read-only section.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>

Reviewed-by: Roger Quadros <rogerq@kernel.org>
MD Danish Anwar July 5, 2024, 4:41 a.m. UTC | #2
On 04/07/24 3:16 am, Javier Carrasco wrote:
> `am654_icss_iep_regmap_config` is only assigned to a pointer that passes
> the data as read-only.
> 
> Add the const modifier to the struct and pointer to move the data to a
> read-only section.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>

Reviewed-by: MD Danish Anwar <danishanwar@ti.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/ti/icssg/icss_iep.c b/drivers/net/ethernet/ti/icssg/icss_iep.c
index 003668dee738..75c294ce6fb6 100644
--- a/drivers/net/ethernet/ti/icssg/icss_iep.c
+++ b/drivers/net/ethernet/ti/icssg/icss_iep.c
@@ -95,7 +95,7 @@  enum {
  * @flags: Flags to represent IEP properties
  */
 struct icss_iep_plat_data {
-	struct regmap_config *config;
+	const struct regmap_config *config;
 	u32 reg_offs[ICSS_IEP_MAX_REGS];
 	u32 flags;
 };
@@ -952,7 +952,7 @@  static int icss_iep_regmap_read(void *context, unsigned int reg,
 	return 0;
 }
 
-static struct regmap_config am654_icss_iep_regmap_config = {
+static const struct regmap_config am654_icss_iep_regmap_config = {
 	.name = "icss iep",
 	.reg_stride = 1,
 	.reg_write = icss_iep_regmap_write,